Skip to content
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

fix: correctly translate paths when using bash in windows #96

Merged
merged 1 commit into from
Jul 12, 2022

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