Skip to content
This repository was archived by the owner on Jun 3, 2025. It is now read-only.

Commit 4f35cea

Browse files
authored
Make install.sh less smart
1 parent df3b501 commit 4f35cea

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

scripts/install.sh

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,9 @@
33
set -euo pipefail
44

55
echo "~ Installing TMC-CLI ~"
6+
echo "(If your shell is not bash, you may have to do the installation manually.)"
67
echo ""
78

8-
if [ -f $HOME/.tmc-autocomplete.sh ]; then
9-
echo -e ".tmc-autocomplete is already installed try adding the following line to your bashrc file."
10-
echo "source $HOME/.tmc-autocomplete.sh"
11-
exit
12-
fi
13-
149
echo "Fetching latest release URL"
1510
if ! PAGE=$(curl -s https://api.github.com/repos/testmycode/tmc-cli/releases/latest); then
1611
echo "Failed to fetch latest release from github api." >&2
@@ -29,7 +24,13 @@ if [ ! -f ./tmc ]; then
2924
exit 1
3025
fi
3126

27+
if [ -f "$HOME/.tmc-autocomplete.sh" ]; then
28+
rm "$HOME/.tmc-autocomplete.sh" || true
29+
fi
30+
3231
chmod u+x ./tmc
3332
./tmc
3433

35-
echo "Installation complete"
34+
echo "source $HOME/.tmc-autocomplete.sh || true" >> "$HOME/.bashrc"
35+
36+
echo "Installation complete. Please restart the terminal."

0 commit comments

Comments
 (0)