-
Notifications
You must be signed in to change notification settings - Fork 124
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
Environment variable issue on windows #62
Comments
Windows use the %var% syntax. [tasks.default.windows]
# if we want to keep rest of task definition just define the runner for windows
# and rest will be taken from original task
script_runner = "bash" Another option is to use the cross platform shell runner that can convert only very basic scripts from shell to batch if task is executed on windows. See docs [tasks.shell]
script_runner = "@shell"
script = [
'''
rm ./myfile.txt
'''
] |
@Cokemonkey11 does it resolve your issue or do you need any changes? |
Hi, Sorry for the huge delay. My concern then is that when executing in a bash enviroment on a windows host (for example with MSYS2), the script runner choses windows style script. I think this is also a design smell. I think script_runner should always default to unix-style shell. How is this being detected, by the way? |
I have to disagree, I think it should default based on the OS default shell and let the user change that manually, which you can.
Its been done using normal rust cfg! macro and implemented in the run_script crate (https://github.com/sagiegurari/run_script) if cfg!(windows) {
"cmd.exe"
} else {
"sh"
} |
I think your response is of the form "run_script doesn't do the right thing here" Fundamentally, I'm running in a shell environment, and my OS has quite little to do with that. That doesn't mean the onus is on you to change it though |
Don't think run_script doesn't do the right thing. I wrote it, so it actually does what I wanted it to :) |
closing due to no feedback |
Sorry, didn't mean to blank you. No feedback at this time. My view is that, given that |
The following won't work as expected on bash nor msys2:
Emits:
The text was updated successfully, but these errors were encountered: