Skip to content

Commit 939dd3a

Browse files
committed
Fix issues in quirks.nix
If GITHUB_ACTIONS is not defined the check "$GITHUB_ACTIONS" = "true" might fail. The CODESPACES variable is always set to "true" in GitHub Codespaces so we can use the same mechanism there.
1 parent b153ade commit 939dd3a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

quirks.nix

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,20 @@
2121
echo ""
2222
'';
2323
hint = flavor: ''
24-
if [ "$GITHUB_ACTIONS" = "true" ]; then
24+
if [[ "x''${GITHUB_ACTIONS:-}" == xtrue ]]; then
2525
PREFIX="::notice::Hint:"
2626
else
2727
PREFIX="Hint:"
2828
fi
29-
if [ "$GITHUB_ACTIONS" = "true" ] || [ "$'' + ''{CODESPACE_TOKEN+x}" = "x" ]; then
29+
if [[ "x''${GITHUB_ACTIONS:-}" == xtrue || "x''${CODESPACES:-}" == xtrue ]]; then
3030
echo "$PREFIX to reproduce this environment locally, use either:" \
3131
"\`nix develop github:input-output-hk/devx#${flavor}\`, or" \
3232
"\`docker run -it -v \$(pwd):/workspaces ghcr.io/input-output-hk/devx-devcontainer:x86_64-linux.${flavor}\`"
3333
fi
34-
if [ "$'' + ''{CODESPACE_TOKEN+x}" = "x" ]; then
34+
if [[ "x''${CODESPACES:-}" == xtrue ]]; then
3535
echo "Quirks:"
3636
echo -e "\tThe Haskell VSCode extension might ask you \"How do you want the extension to manage/discover HLS and the relevant toolchain?\""
3737
echo -e "\tChoose \"Manually via PATH\", not \"Automatically via GHCup\""
3838
fi
3939
'';
40-
}
40+
}

0 commit comments

Comments
 (0)