Skip to content

Commit 8cdbf5a

Browse files
committed
Add a shell check
1 parent 5fe5adc commit 8cdbf5a

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

cvm.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,11 +170,30 @@ checkDependencies() {
170170
done
171171
}
172172

173+
isShellSupported() {
174+
case "$(basename "$SHELL")" in
175+
sh|dash|bash|zsh)
176+
return 0
177+
;;
178+
*)
179+
return 1
180+
;;
181+
esac
182+
}
183+
173184

174185

175186
#
176187
# Execution
177188
#
189+
if ! isShellSupported; then
190+
echo "Error: Unsupported shell. Please use bash, zsh, or sh."
191+
echo "Currently using: $(basename "$SHELL")"
192+
echo "Open a github issue if you want to add support for your shell:"
193+
echo "https://github.com/ivstiv/cursor-version-manager/issues"
194+
exit 1
195+
fi
196+
178197
checkDependencies
179198
mkdir -p "$DOWNLOADS_DIR"
180199

0 commit comments

Comments
 (0)