diff --git a/Dockerfile b/Dockerfile index 2d9dc4b..2e23277 100644 --- a/Dockerfile +++ b/Dockerfile @@ -48,6 +48,9 @@ RUN mkdir -p /usr/local/bin/ \ PROJECT_DIR=\$(find /workspaces/ -mindepth 1 -maxdepth 1 -type d ! -name '.*' -print -quit) if [ -n "\$PROJECT_DIR" ]; then pushd \$PROJECT_DIR > /dev/null + # HLS error (Couldn't load cradle for ghc libdir) if `cabal update` has never been run in project using cardano-haskell-packages ... + echo "Running `cabal update` ..." + bash -ic "cabal update" # GitHub Codespaces should have \$GITHUB_TOKEN already set. if [ -n "\$GITHUB_TOKEN" ]; then echo \$GITHUB_TOKEN | gh auth login --with-token @@ -59,9 +62,6 @@ if [ -n "\$PROJECT_DIR" ]; then else echo "\\\$GITHUB_TOKEN is not set. Skipping HLS cache download." fi - # HLS error (Couldn't load cradle for ghc libdir) if `cabal update` has never been run in project using cardano-haskell-packages ... - echo "Running `cabal update` ..." - bash -c "cabal update" popd > /dev/null fi EOF diff --git a/quirks.nix b/quirks.nix index 27c8a7b..9753bdd 100644 --- a/quirks.nix +++ b/quirks.nix @@ -22,9 +22,19 @@ ''; hint = flavor: '' if [ "$GITHUB_ACTIONS" = "true" ]; then - echo "::notice::Hint: 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}\`" + PREFIX="::notice::Hint:" + else + PREFIX="Hint:" + fi + if [ "$GITHUB_ACTIONS" = "true" ] || [ -n "$CODESPACE_TOKEN" ]; 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 [ -n "$CODESPACE_TOKEN" ]; 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