Skip to content
Merged
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
36 changes: 31 additions & 5 deletions .github/daily-integration-test/verify-destroyed.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,40 @@
#!/bin/bash
set -euo pipefail
set -uo pipefail

fail=0

if [ -d "$HOME/.nvm" ]; then
echo "FAIL: ~/.nvm still exists after destroy" >&2
exit 1
ls -la "$HOME/.nvm" >&2
fail=1
fi

if [ -d "$HOME/.goenv" ] || command -v goenv >/dev/null 2>&1; then
echo "FAIL: goenv still present after destroy" >&2
exit 1
# Check for goenv itself, not for $GOENV_ROOT as a whole. On the macOS runner the Go module
# cache lives at $GOENV_ROOT/shared/go-mod and is repopulated by Go tooling after the destroy,
# so the bare directory existing says nothing about whether goenv is still installed.
for leftover in "$HOME/.goenv/bin" "$HOME/.goenv/shims" "$HOME/.goenv/versions"; do
if [ -d "$leftover" ]; then
echo "FAIL: $leftover still exists after destroy" >&2
ls -la "$leftover" >&2
fail=1
fi
done

if command -v goenv >/dev/null 2>&1; then
echo "FAIL: 'goenv' is still resolvable after destroy" >&2
echo " command -v goenv -> $(command -v goenv)" >&2
echo " type goenv -> $(type goenv 2>&1 | head -3)" >&2
IFS=: read -ra _dirs <<< "$PATH"
for _d in "${_dirs[@]}"; do
[ -e "$_d/goenv" ] && echo " on PATH: $_d/goenv" >&2
done
if command -v brew >/dev/null 2>&1; then
brew list --formula 2>/dev/null | grep -x goenv >/dev/null \
&& echo " brew still lists the goenv formula" >&2
fi
fail=1
fi

[ "$fail" -ne 0 ] && exit 1

echo "nvm and goenv confirmed removed."
Loading