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 ShellTask on win32 #4397

Merged
merged 5 commits into from
Apr 14, 2021
Merged

Fix ShellTask on win32 #4397

merged 5 commits into from
Apr 14, 2021

Conversation

zanieb
Copy link
Contributor

@zanieb zanieb commented Apr 13, 2021

Summary

The ShellTask does not work on win32 because it does not look for executables in the path by default. This sets Popen(..., shell=True) when using win32 which inspects the path for the given executable.

You still need bash installed and on your PATH for this to work by default. Other shells should work without issue as well, but cmd.exe does not seem to support running a script.

Importance

Closes #1984 #4393

Checklist

This PR:

  • adds new tests (if appropriate)
  • adds a change file in the changes/ directory (if appropriate)
  • updates docstrings for any new functions or function arguments, including docs/outline.toml for API reference docs (if appropriate)

On windows, the single `\` in the path disappears when evaluated by bash so we need to have double `\\` in the string written to the file.
@zanieb zanieb changed the title Add shell path inference for windows ShellTask Allow the ShellTask to be used on win32 Apr 14, 2021
@zanieb zanieb changed the title Allow the ShellTask to be used on win32 Fix ShellTask on win32 Apr 14, 2021
@zanieb zanieb marked this pull request as ready for review April 14, 2021 01:03
@zanieb zanieb requested a review from jcrist as a code owner April 14, 2021 01:03
@zanieb zanieb requested review from zangell44 and cicdw April 14, 2021 01:03
Copy link
Member

@cicdw cicdw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice detective work

@zanieb zanieb merged commit 0e82211 into master Apr 14, 2021
@zanieb zanieb deleted the fix-shell-task branch April 14, 2021 14:21
@zanieb zanieb mentioned this pull request Apr 14, 2021
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.

WindowsShellTask or Windows support for ShellTask
3 participants