You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fish interpreter fails to execute code snippets with command substitution error: command substitutions not allowed in command position. Try var=(your-cmd) $var ... __cleanup() {#827
When specifying fish as the interpreter for a code snippet in Runme, the execution fails with a command substitution error. The same code snippet works correctly when using bash as the interpreter.
The snippet should execute successfully and output:
Hello, World!
Actual Behavior
The execution fails with the following error:
/tmp/runme/.runme-script-01JYD6NM79ARD8D9CYNNX3T5JH.sh (line 2): command substitutions not allowed in command position. Try var=(your-cmd) $var ...
__cleanup() {
^^
warning: Error while reading file /tmp/runme/.runme-script-01JYD6NM79ARD8D9CYNNX3T5JH.sh
could not execute command: failed to run command "fish-test": exit code: 127
Additional Context
The same code snippet works correctly when using bash as the interpreter:
Running runme run bash-test produces the expected output:
Hello, World!
Possible Cause
It appears that Runme might be generating a shell script with bash-specific syntax (such as the __cleanup() function definition) that is incompatible with fish shell's syntax. Fish has a different syntax for function definitions and doesn't support the same command substitution syntax as bash.
Suggested Solution
When using fish as an interpreter, Runme should either:
Generate fish-compatible wrapper scripts, or
Use a different approach that doesn't rely on bash-specific syntax in the wrapper script