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

exec: specify shell to run the command in #229

Open
SaschaMann opened this issue Nov 24, 2019 · 2 comments · Fixed by #258 · May be fixed by #285
Open

exec: specify shell to run the command in #229

SaschaMann opened this issue Nov 24, 2019 · 2 comments · Fixed by #258 · May be fixed by #285
Labels
enhancement New feature or request

Comments

@SaschaMann
Copy link

Describe the enhancement
Add an option to exec.exec to invoke a specific shell, e.g. /bin/bash, when running the command.
Alternatively, document that exec.exec does not invoke a shell by default.

Code Snippet
Currently:

await exec.exec('/bin/bash', ['-c', `cp -a /Volumes/Julia-*/Julia-*.app/Contents/Resources/julia ${process.env.HOME}`])

Better:

await exec.exec('cp', ['-a', '/Volumes/Julia-*/Julia-*.app/Contents/Resources/julia', `${process.env.HOME}/julia`], {'shell': '/bin/bash'})

Additional information
The docs say that "you can use this package to execute your tools on the command line in a cross platform way". To me that implies it invokes a shell, which it doesn't. This misunderstanding has caused me quite the headache when I tried to find out why cp wasn't working with wildcards.

Disclaimer: I have almost zero experience with Typescript, perhaps this behaviour is obvious to people who regularly use it. 🤷‍♂

@eine
Copy link

eine commented Dec 3, 2019

Ref #232

@ericsciple ericsciple added documentation and removed enhancement New feature or request labels Dec 16, 2019
@alexkappa
Copy link

It seems the solution to this issue has been to change the wording in documentation, while the actual issue was not addressed imho.

I'll be submitting a PR which allows defining the shell as with child_process options.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
4 participants