Skip to content

Commit 2baa4ce

Browse files
Exit if curl is not installed
1 parent 20f2313 commit 2baa4ce

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

public/install-go.sh

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,17 @@
44
# Multi-platform (Linux and macOS)
55
# Multi-architecture (amd64, arm64, arm) support
66

7-
deps=( curl jq )
7+
# if curl is not installed then install it
8+
if ! command -v curl &> /dev/null; then
9+
echo "curl is not installed. Please install curl and try again."
10+
exit 1
11+
fi
812

9-
for dep in "${deps[@]}"; do
10-
if ! command -v "$dep" &> /dev/null; then
11-
echo "$dep is not installed. Downloading and executing the script..."
12-
curl -sSL https://rollkit.dev/install-jq.sh | bash
13-
fi
14-
done
13+
# if jq is not installed then install it using the script
14+
if ! command -v jq &> /dev/null; then
15+
echo "jq is not installed. Downloading and executing the script..."
16+
curl -sSL https://rollkit.dev/install-jq.sh | bash
17+
fi
1518

1619
version="${1:-$(curl -s 'https://go.dev/dl/?mode=json' | jq -r '.[0].version')}"
1720
current="$(/usr/local/go/bin/go version 2>/dev/null | awk '{print $3}')"

0 commit comments

Comments
 (0)