Skip to content

Commit 183993c

Browse files
authored
fix install.sh (#219)
fix it for sh
1 parent 7bcfd2a commit 183993c

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

scripts/install.sh

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Options:
1212
-f, --force Force overwriting an existing binary
1313
--os OS Your current OS, it's used to determine the type of binary to be installed (one of darwin or win32 or linux)
1414
--cpu CPU Your current CPU architecture, it's used to determine the type of binary to be installed (one of x32 or x64 or arm64)
15-
--artifact ARTIFACT Specific artifact to install. Please find the artifact name from https://github.com/JasonShin/sqlx-ts/releases (e.g. sqlx_ts_v0.1.0_x86_64-apple-darwin.zip)
15+
--artifact ARTIFACT Specific artifact to install. Please find the artifact name from https://github.com/JasonShin/sqlx-ts/releases (e.g. sqlx-ts-v0.26.0-macos-arm.zip)
1616
--tag TAG Tag (version) of the crate to install (default <latest release>)
1717
--to LOCATION Where to install the binary (default to the current directory)
1818
EOF
@@ -150,22 +150,22 @@ say_err "Installing to: $dest"
150150
# if only OS is given use OS + version | latest
151151
if [ -z $artifact ]; then
152152
target=""
153-
if [ "$os" == "darwin" ]; then
154-
if [ "$cpu" == "arm64" ]; then
153+
if [ "$os" = "darwin" ]; then
154+
if [ "$cpu" = "arm64" ]; then
155155
target="macos-arm.zip"
156156
else
157157
target="macos-64-bit.zip"
158158
fi
159-
elif [ "$os" == "win32" ]; then
160-
if [ "$cpu" == "x64" ]; then
159+
elif [ "$os" = "win32" ]; then
160+
if [ "$cpu" = "x64" ]; then
161161
target="windows-64-bit.zip"
162162
else
163163
target="windows-32-bit.zip"
164164
fi
165-
elif [ "$os" == "linux" ]; then
166-
if [ "$cpu" == "x64" ]; then
165+
elif [ "$os" = "linux" ]; then
166+
if [ "$cpu" = "x64" ]; then
167167
target="linux-64-bit.zip"
168-
elif [ "$cpu" == "arm64" ]; then
168+
elif [ "$cpu" = "arm64" ]; then
169169
target="linux-arm.zip"
170170
else
171171
target="linux-32-bit.zip"
@@ -181,7 +181,7 @@ if [ -z $artifact ]; then
181181
fi
182182
url="$url/download/$tag/sqlx-ts-${tag}-${target}"
183183
else
184-
tag="$(cut -d'_' -f3 <<< "$artifact")"
184+
tag=$(echo "$artifact" | cut -d'-' -f3)
185185
url="$url/download/$tag/$artifact"
186186
fi
187187

@@ -191,7 +191,7 @@ echo "URL to download $url"
191191

192192
curl -LSfs $url --output $td/sqlx-ts.zip
193193
unzip -j $td/sqlx-ts.zip -d $td
194-
if [ "$os" == "win32" ]; then
194+
if [ "$os" = "win32" ]; then
195195
cp $td/sqlx-ts.exe .
196196
else
197197
cp $td/sqlx-ts .

0 commit comments

Comments
 (0)