Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
18 changes: 14 additions & 4 deletions quirks.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
'';
}
}