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

Respect shebang of task file #7

Open
jotaen opened this issue Jan 28, 2022 · 0 comments
Open

Respect shebang of task file #7

jotaen opened this issue Jan 28, 2022 · 0 comments

Comments

@jotaen
Copy link
Owner

jotaen commented Jan 28, 2022

Currently, the run.sh task file is interpreted by bash.

If run.sh is configured with #!/bin/zsh or something other, that setting is ignored, which might lead to unexpected behaviour.

The runner could support a number of different shells and automatically invoke them by parsing the shebang. There are a few things to keep in mind about this:

  • The run.sh file format is not POSIX-compliant, due to the run:: prefix. /bin/sh or the like can therefore not be supported.
  • It might be difficult to reliably determine the shell name from the shebang string:
    • The path is not canonical, so it can be /bin/bash, /usr/bin/env bash, /usr/local/bin/bash etc.
    • It might not be safe to rely on the name of the shell executable
  • Shebangs are usually interpreted by the operating system, and so the behaviour is not standardised across OSses (see here for more reading). Not sure it’s a good idea or even possible to re-implement that properly.

So in the end, there might also be other approaches to solve this problem.

@jotaen jotaen changed the title Respect shebang of task file? Respect shebang of task file Dec 1, 2022
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

No branches or pull requests

1 participant