Skip to content

Commit 3ab51fa

Browse files
committed
fix: debug why goenv is not uninstalled
1 parent 7f6e0c7 commit 3ab51fa

1 file changed

Lines changed: 27 additions & 5 deletions

File tree

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,36 @@
11
#!/bin/bash
2-
set -euo pipefail
2+
set -uo pipefail
3+
4+
fail=0
35

46
if [ -d "$HOME/.nvm" ]; then
57
echo "FAIL: ~/.nvm still exists after destroy" >&2
6-
exit 1
8+
ls -la "$HOME/.nvm" >&2
9+
fail=1
10+
fi
11+
12+
if [ -d "$HOME/.goenv" ]; then
13+
echo "FAIL: ~/.goenv directory still exists after destroy" >&2
14+
ls -laR "$HOME/.goenv" >&2
15+
fail=1
716
fi
817

9-
if [ -d "$HOME/.goenv" ] || command -v goenv >/dev/null 2>&1; then
10-
echo "FAIL: goenv still present after destroy" >&2
11-
exit 1
18+
if command -v goenv >/dev/null 2>&1; then
19+
echo "FAIL: 'goenv' is still resolvable after destroy" >&2
20+
echo " command -v goenv -> $(command -v goenv)" >&2
21+
echo " type goenv -> $(type goenv 2>&1 | head -3)" >&2
22+
echo " PATH -> $PATH" >&2
23+
IFS=: read -ra _dirs <<< "$PATH"
24+
for _d in "${_dirs[@]}"; do
25+
[ -e "$_d/goenv" ] && echo " on PATH: $_d/goenv" >&2
26+
done
27+
if command -v brew >/dev/null 2>&1; then
28+
brew list --formula 2>/dev/null | grep -x goenv >/dev/null \
29+
&& echo " brew still lists the goenv formula" >&2
30+
fi
31+
fail=1
1232
fi
1333

34+
[ "$fail" -ne 0 ] && exit 1
35+
1436
echo "nvm and goenv confirmed removed."

0 commit comments

Comments
 (0)