Codespaces devcontainer prebuild postCreateCommand uses sh instead of bash

16 Views Asked by At

I'm wondering if anyone knows how to get the prebuild postCreateCommand below to use bash instead of sh. We have this in our devcontainer.json:

"postCreateCommand": "source /workspaces/devcontainer/init.sh"

Which runs during prebuild stage, but fails with the following error:

/bin/sh: 1: source: not found

If the command is run with bash it works well, unfortunately my Linux (and devcontainer) knowledge is severely lacking so I don't even know where to really start. The image being used is the standard mcr.microsoft.com/devcontainers/universal:linux I've tried setting the SHELL env var to /bin/bash; replacing source with . stopped the source error, but unfortunately there are many other commands further into that shell script that really just need to be run with bash. Thanks so much

0

There are 0 best solutions below