canonical / canonical/spread

feat: flag to select shell to use in adhoc scripts

Open
#203 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
127
Forks
81
PR merge metrics
No merged PRs in 30d

Description

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: |
...
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by tracing how spread parses task configuration and launches adhoc scripts. Check how the default shell is selected and where a per-task shell parameter could be applied. Done means an adhoc task can select its shell, while existing tasks retain current behavior and the shell-specific case is covered by tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, shell
Domain
cli, testing
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.