Skip to content

Conversation

nlf
Copy link
Contributor

@nlf nlf commented Jul 12, 2022

this fixes the issue when using bash as the script-shell in windows, the problem was that we were passing a windows path to bash as a script to run. to correct it, we translate C: to /c and replace all backslashes with forward slashes. as an example, C:\\Directory\\filename becomes /C/Directory/filename

correcting this problem brought to light a few things that make the module simpler:

  1. we no longer need a shebang, or the -c flag when using bash
  2. we no longer need to chmod +x the script file
  3. we no longer need to escape the filename passed as an argument to bash
  4. we no longer spawn a bash that spawns another bash to run your script

no changes were made to the cmd.exe behavior

closes #90

@nlf nlf requested a review from a team as a code owner July 12, 2022 17:19
@nlf nlf merged commit 756ff56 into main Jul 12, 2022
@nlf nlf deleted the nlf/fix-bash-in-windows branch July 12, 2022 17:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] "command not found" when running script with bash as script-shell on Windows
2 participants