Skip to content

Commit a91fe20

Browse files
committed
Use '$SHELL' if it's defined on the image, if not, look for 'bash', and finally use 'sh' if everything else fails
1 parent d163c3b commit a91fe20

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

components/gitpod-cli/cmd/rebuild.go

+8-9
Original file line numberDiff line numberDiff line change
@@ -181,24 +181,23 @@ func runRebuild(ctx context.Context, supervisorClient *supervisor.SupervisorClie
181181
dockerPath,
182182
"run",
183183
"--rm",
184-
"-e", fmt.Sprintf("SHELL=%s", os.Getenv("SHELL")),
185184
"-v", "/workspace:/workspace",
186185
"--label", "gp-rebuild=true",
187186
"-it", tag,
188-
"/bin/sh",
187+
"sh",
189188
"-c",
190189
fmt.Sprintf(`
191190
echo "%s";
192191
cd "%s";
193-
if [ -x "$(command -v /bin/bash)" ]; then
194-
if [ -x "$(command -v $SHELL)" ]; then
195-
$SHELL;
192+
if [ -x "$(command -v $SHELL)" ]; then
193+
$SHELL;
194+
else
195+
if [ -x "$(command -v bash)" ]; then
196+
bash;
196197
else
197-
/bin/bash;
198+
sh;
198199
fi;
199-
else
200-
/bin/sh;
201-
fi
200+
fi;
202201
`, welcomeMessage, wsInfo.CheckoutLocation),
203202
)
204203

0 commit comments

Comments
 (0)