-
Notifications
You must be signed in to change notification settings - Fork 540
Cross-platform sh
via deno
or busybox
#2671
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Immediately after posting this, I remembered to search winget for
The great thing about busybox is that it bakes-in the standard suite of unix tools which are often shipped as external binaries -- Setup like so:
|
sh
via deno
sh
via deno
or busybox
Good find! I think that's something that could probably be added to the readme, assuming that there are no gotchas. |
I wanted to quickly share an option for writing cross-platform justfiles using (limited) sh-style syntax: leverage
deno
'stask
subcommand.Context
I'm an OSS maintainer, projects support Windows, I want to use justfiles, I must make it extremely easy for potential contributors to install all necessary dependencies that are outside of the language ecosystem's core tools. For example, Golang devs obviously have golang installed, but they shouldn't be expected to jump through hoops to install shells and command runners.
Setup
Tell just to use deno's
sh
interpreter subcommand,deno task
.PowerShell can't do this, because PowerShell's
cat
is subtly different -- breaks newlines, breaks binary files -- and PowerShell doesn't do*
globbing.Deno handles it correctly.
Installation
For contributors on Windows:
Why deno?
"Isn't deno a JavaScript/TypeScript thing? I hate JavaScript/TypeScript! My project is C#/golang/rust/etc!"
In this case, we are using deno's built-in ability to run one-line commands written in
sh
-style syntax, exactly whatjust
needs for vanilla recipes!We are not running any JavaScript.
https://docs.deno.com/runtime/reference/cli/task/#syntax
Deno installs as a single, ~100MB binary file.
The text was updated successfully, but these errors were encountered: