runme
runme copied to clipboard
`runme open` fails to install code-server when executing in fish shell
I have a macos+fish environment. Next command fails (executed in fish shell):
> runme open
No code-server installation found. Do you want to install coder's code-server?
fish: command substitutions not allowed here
__cleanup() {
^^
could not execute command: installation command failed: failed to run command: exit code: 127
Next command works fine (also executed in fish shell):
> SHELL=zsh runme open
This error indicates that the problem is likely related to the code used to collect environment variables in the session. It's not well-tested across various shells.
Does it happen only for runme open or for runme run <cmd> as well?
Does it happen only for
runme openor forrunme run <cmd>as well?
Yes, it is the same error for runme run FILE_LIST for example repo:
> git clone --depth=1 https://github.com/stateful/docs.runme.dev.git
> runme run FILE_LIST
fish: command substitutions not allowed here
__cleanup() {
^^
could not execute command: failed to run command "FILE_LIST": exit code: 127
Thanks for checking! I think bash, zsh and fish in fairly new versions should work well. We can run tests in a Docker container so we should be able to cover all shells easily. @sourishkrout wdyt?
Thanks for checking! I think bash, zsh and fish in fairly new versions should work well. We can run tests in a Docker container so we should be able to cover all shells easily. @sourishkrout wdyt?
Sure thing. zsh works for sure. fish used to not but with the latest upgrades might. We are working on a warning notification inside the extension to flag unsupported PowerShell etc right now. Would be great if we could move fish to supported but not a high priority.
I've ran into this problem too. I tried setting the interpretor, but I assume this is ignored when running interactively in a shell.
It would be good if this was respected.
\```shell {"id":"01J6HHJDW3A84XPHVHSWC3DC6W","interpreter":"/usr/bin/env bash","name":"deploy"}
sudo nixos-rebuild switch --fast --flake .#(hostname)
\```
Thanks for the feedback, @rawkode! The way you'd enforce bash is by using frontmatter in the document as per https://docs.runme.dev/Reference/configuration#document-options
So what you'd want to do is use that instead of interpreter, e.g.:
---
shell: bash
---
# Documentation
This is my doc
It's also possible to do this per cell but I'd recommend setting it per document instead.