@@ -22,7 +22,8 @@ const (
22
22
23
23
const devcontainerUpScriptTemplate = `
24
24
if ! which devcontainer > /dev/null 2>&1; then
25
- echo "ERROR: Unable to start devcontainer, @devcontainers/cli is not installed."
25
+ echo "ERROR: Unable to start devcontainer, @devcontainers/cli is not installed or not found in \$PATH." 1>&2
26
+ echo "Please install @devcontainers/cli by running \"npm install -g @devcontainers/cli\" or by using the \"devcontainers-cli\" Coder module." 1>&2
26
27
exit 1
27
28
fi
28
29
devcontainer up %s
@@ -65,7 +66,9 @@ func devcontainerStartupScript(dc codersdk.WorkspaceAgentDevcontainer, script co
65
66
args = append (args ,fmt .Sprintf ("--config %q" ,dc .ConfigPath ))
66
67
}
67
68
cmd := fmt .Sprintf (devcontainerUpScriptTemplate ,strings .Join (args ," " ))
68
- script .Script = cmd
69
+ // Force the script to run in /bin/sh, since some shells (e.g. fish)
70
+ // don't support the script.
71
+ script .Script = fmt .Sprintf ("/bin/sh -c '%s'" ,cmd )
69
72
// Disable RunOnStart, scripts have this set so that when devcontainers
70
73
// have not been enabled, a warning will be surfaced in the agent logs.
71
74
script .RunOnStart = false