From 939dd3a9e313caa5948245184ca79a255bef08a1 Mon Sep 17 00:00:00 2001 From: Andrea Bedini Date: Fri, 18 Jul 2025 13:40:05 +0800 Subject: [PATCH] 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. --- quirks.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/quirks.nix b/quirks.nix index fb34a1f..8b3dee0 100644 --- a/quirks.nix +++ b/quirks.nix @@ -21,20 +21,20 @@ echo "" ''; hint = flavor: '' - if [ "$GITHUB_ACTIONS" = "true" ]; then + if [[ "x''${GITHUB_ACTIONS:-}" == xtrue ]]; then PREFIX="::notice::Hint:" else PREFIX="Hint:" fi - if [ "$GITHUB_ACTIONS" = "true" ] || [ "$'' + ''{CODESPACE_TOKEN+x}" = "x" ]; then + if [[ "x''${GITHUB_ACTIONS:-}" == xtrue || "x''${CODESPACES:-}" == xtrue ]]; then echo "$PREFIX to reproduce this environment locally, use either:" \ "\`nix develop github:input-output-hk/devx#${flavor}\`, or" \ "\`docker run -it -v \$(pwd):/workspaces ghcr.io/input-output-hk/devx-devcontainer:x86_64-linux.${flavor}\`" fi - if [ "$'' + ''{CODESPACE_TOKEN+x}" = "x" ]; then + if [[ "x''${CODESPACES:-}" == xtrue ]]; then echo "Quirks:" echo -e "\tThe Haskell VSCode extension might ask you \"How do you want the extension to manage/discover HLS and the relevant toolchain?\"" echo -e "\tChoose \"Manually via PATH\", not \"Automatically via GHCup\"" fi ''; -} \ No newline at end of file +}