Skip to content

Commit 043134c

Browse files
committed
Added support for version pinning in install.sh
1 parent 3249595 commit 043134c

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

Diff for: install.sh

+16-2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,16 @@
44
# See https://github.com/Masterminds/glide/blob/master/LICENSE for more details
55
# and copyright notice.
66

7+
#
8+
# Usage:
9+
#
10+
# To install the latest version of the CLI:
11+
# ./install.sh
12+
#
13+
# To pin a specific release of the CLI:
14+
# ./install.sh 0.9.0
15+
#
16+
717
PROJECT_NAME="arduino-cli"
818

919
# BINDIR represents the local bin location, defaults to ./bin.
@@ -119,7 +129,11 @@ getFile() {
119129
}
120130

121131
downloadFile() {
122-
checkLatestVersion TAG
132+
if [ -z $1 ]; then
133+
checkLatestVersion TAG
134+
else
135+
TAG=$1
136+
fi
123137
echo "TAG=$TAG"
124138
# arduino-cli_0.4.0-rc1_Linux_64bit.[tar.gz, zip]
125139
if [ "$OS" = "Windows" ]; then
@@ -196,6 +210,6 @@ set -e
196210
initArch
197211
initOS
198212
initDownloadTool
199-
downloadFile
213+
downloadFile $1
200214
installFile
201215
testVersion

0 commit comments

Comments
 (0)