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

feat: flag to select shell to use in adhoc scripts #203

Open
bepri opened this issue Jan 9, 2025 · 0 comments
Open

feat: flag to select shell to use in adhoc scripts #203

bepri opened this issue Jan 9, 2025 · 0 comments

Comments

@bepri
Copy link

bepri commented Jan 9, 2025

Currently, spread assumes that the default shell is Bourne-like (perhaps specifically bash?) and runs adhoc scripts with whatever that default shell currently is. I recently changed my default shell from zsh to fish, and this broke a spread test for me.

Example:

multipass:
  type: adhoc
  allocate: |
    # something that works in zsh, but not fish
    COUNT="1"; echo $(($COUNT + 1))
    # the fish equivalent for convenience
    # set COUNT "1"; echo $(math $COUNT + 1)

Running a spread task with this config in zsh will work, but if your default shell is fish then you'll get fish errors:

++ COUNT="1"; echo $(($COUNT + 1))
fish: Unsupported use of '='. In fish, please use 'set COUNT "1"'.
COUNT="1"; echo $(($COUNT + 1))
^~~~~~~~^

I think it would be useful to have another parameter that could be set on these scripts:

multipass:
  type: adhoc
  shell: /usr/bin/bash
  allocate: |
    ...
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