-
Notifications
You must be signed in to change notification settings - Fork 454
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
A different syntax for set shell
?
#1190
Comments
Maybe my reply is off topic: |
How you use it? Can you use the same |
With the justfile I mean. |
Nushell works on mac, Linux and windows so
|
This is kind of what |
Ok. I'm waiting for |
@casey sorry for the ping here, just to ask if Using |
@frederikhors Hard to say! I'm pretty busy with other projects, so I can't give a timeline for anything. I was thinking that perhaps, instead of providing a To use it, you would do:
Not only does this allow using cc: @runeimp What do you think? |
I agree! Thanks! |
I added a user feedback thread, locked so it's low-spam if you subscribe, here: #1202 There's a bit of commentary about this change. I'll probably let it sit for a few days and see if anyone has anything to say, since I'm always nervous I'll mess something up with Windows, but otherwise it's good to go. |
Subscribed. Thanks. I’ll use windows unfortunately for the next months, so I can give you good hints on it. |
This is done and released as of 1.2.0, |
I have tried your new feature and it works great! Thanks! Unfortunately since I opened the issue the justifle has grown dramatically and today I find myself with a lot of code partly executed on "sh.exe" and partly executed on "pwsh.exe" (because on "sh.exe" executables like "heroku" or "npm" do not work!). Today I tried to run with Incredible! So I think I'll not use {{if os_family() == "windows" { "pwsh.exe -c" } else { "" } }} heroku some_command It would be great to have a short form prefix to the command, like: backup:
!windows heroku some_command
!unix heroku some_other but I don't want to take away any more your time with another request. If you want I can open an issue for this, but only if you want. Congratulations again on what you are doing! |
Interesting addition @casey ! But, most likely the best cross platform options are just using Nushell if you lean towered the POSIX side of shell scripting or PowerShell if you lean towards the Windows side. As noted by @hustcer Nushell runs on Linux, macOS, and Windows. PowerShell is also available for Linux, macOS, and Windows now. There will always be logic situations that require extra coding depending on if you're on Windows or not but one of those two options will at least give you consistent flow control logic, etc. |
Thinking about it better, even after #1185, I thought that perhaps the way to indicate the shell should be revised.
I'll explain.
On Windows you have arbitrarily chosen to use
sh.exe
(which was installed on my system when I installedGit
).It is a shell that is used by Git for
git-bash.exe
.In my projects I'll have many
justfile
used by many people on Windows, Linux and Mac.Right now I don't have a
set shell := ...
command in thejustfile
and I'm using many times in recipes the conditional string:{{if os_family() == "windows" { "pwsh.exe -c" } else { "" } }}
before the command if that command doesn't work insh.exe
(and works perfectly onpwsh.exe
(I'm not using in that case a bash syntax)).Now I'm writing recipes which use commands like
npm run build
ornpm install
and I don't know why but I'm having hard times making it work because in my systemsh.exe
cannot runnpm
(the PC has just been installed, everything works good, nodejs 16 LTS):I don't have time to further investigate and I don't want too because things need to work on my co-worker PCs too...
Another problem with
sh.exe
are the exit codes from CLI like theheroku
's one and similar made in nodejs. The exit codes are always 1 even if the commands correctly worked.So...
THE REQUEST/QUESTION
Can we have a different
set shell
syntax like the one I'm using on each problematic command?Example:
What do you think?
Basically: I need to have a universal justfile that can be used on all operating systems.
The text was updated successfully, but these errors were encountered: