percy icon indicating copy to clipboard operation
percy copied to clipboard

Bash files in examples to rust-script?

Open Type1J opened this issue 3 years ago • 5 comments

I have people with Windows, macOS, and Linux machines. The Windows machines don't have bash, but they all have, or can get (through cargo), rust-script. Can the scripts be changed to use rust-script instead?

Type1J avatar Apr 25 '21 13:04 Type1J

...or, even better, could it be worked into build.rs somehow?

Type1J avatar Apr 25 '21 15:04 Type1J

Hey there.

The scripts can't be replaced in favor of build scripts because some of the scripts start servers, which you wouldn't want a build script to do.

I'm not too familiar with Windows, but I agree that we want something that works for everyone.

Perhaps we can start by adding scripts called script-name.windows.file-extension that can be run on Windows. Then in the future we could introduce a single approach that worked on any of the major operating systems.

Would that work for you?

chinedufn avatar Apr 30 '21 07:04 chinedufn

Yes, .cmd files in addition to .sh files that do the same thing would work fine.

I was thinking rust-script because its .crs files are just Rust with a comment at the top to say what cargo deps it needs, and it's directly executable (on Linux or macOS, you can chmod 755 run_something.crs, or register .crs on Windows to be run by rust-script) after a cargo install rust-script on any platform.

Type1J avatar May 01 '21 03:05 Type1J

Got it thanks for explaining. Actually, I'd prefer to avoid needing one extra thing for people to install before they can run the examples.

chinedufn avatar May 06 '21 07:05 chinedufn

PowerShell might also be considered an alternative to cmd.

kotx avatar Oct 09 '21 04:10 kotx