Skip to content

Commit 866ae58

Browse files
committed
chore: installation update for windows
1 parent 7c46710 commit 866ae58

File tree

2 files changed

+19
-7
lines changed

2 files changed

+19
-7
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,14 +89,14 @@ To install a specific artifact, [go to the release page to find the exact name o
8989

9090
```bash
9191
$ curl -LSfs https://jasonshin.github.io/sqlx-ts/install.sh | \
92-
sh -s -- --artifact sqlx-ts_v0.1.0_x86_64-apple-darwin.tar.gz
92+
sh -s -- --artifact sqlx_ts_v0.1.0_x86_64-apple-darwin.tar.gz
9393
```
9494

9595
Upgrading to a new version can be done by grabbing the next version of the sqlx-ts artifact and use `--force` command from install.sh
9696

9797
```bash
9898
$ curl -LSfs https://jasonshin.github.io/sqlx-ts/install.sh | \
99-
sh -s -- --artifact sqlx-ts_v0.2.0_x86_64-apple-darwin.tar.gz --force
99+
sh -s -- --artifact sqlx_ts_v0.2.0_x86_64-apple-darwin.tar.gz --force
100100
```
101101

102102
For more advanced usage, please check `--help` command of install.sh

scripts/install.sh

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ Usage:
1010
Options:
1111
-h, --help Display this message
1212
-f, --force Force overwriting an existing binary
13-
--os OS Your current OS, it's used to determine the type of binary to be installed (one of darwin or win32 or linux)
14-
--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)
13+
--os OS Your current OS, it's used to determine the type of binary to be installed (one of macos or win32 or linux)
14+
--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)
1515
--tag TAG Tag (version) of the crate to install (default <latest release>)
16-
--to LOCATION Where to install the binary (default ~/.cargo/bin)
16+
--to LOCATION Where to install the binary (default to ~/.cargo/bin)
1717
EOF
1818
}
1919

@@ -89,7 +89,13 @@ need curl
8989
need install
9090
need mkdir
9191
need mktemp
92-
need tar
92+
93+
if [ "$os" == "macos" ] || [ "$os" == "linux" ]; then
94+
need tar
95+
else
96+
need unzip
97+
fi
98+
9399
need sed
94100

95101
# Optional dependencies
@@ -151,7 +157,13 @@ fi
151157
td=$(mktemp -d || mktemp -d -t tmp)
152158

153159
echo "URL to download $url"
154-
curl -sL $url | tar -C $td -xz
160+
if [ "$os" == "macos" ] || [ "$os" == "linux" ]; then
161+
curl -sL $url | tar -C $td -xz
162+
else
163+
curl -sL -o ./sqlx-ts-latest.zip $url
164+
unzip ./sqlx-ts-latest.zip -d $td
165+
rm -f ./sqlx-ts-latest.zip
166+
fi
155167

156168
# shellcheck disable=SC2045
157169
for f in $(ls $td); do

0 commit comments

Comments
 (0)