Skip to content
This repository was archived by the owner on Dec 15, 2023. It is now read-only.

Commit 5f4d7f3

Browse files
committed
doc: add download shell command
1 parent 70af54b commit 5f4d7f3

File tree

3 files changed

+31
-10
lines changed

3 files changed

+31
-10
lines changed

README.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,19 @@ cargo install -f iotdb-cli
3131
cargo install -f --git https://github.com/francis-du/iotdb-cli.git
3232
```
3333

34-
2. From binary
34+
2. From [binary](https://github.com/francis-du/iotdb-cli/releases/latest)
3535

36-
Download latest `iotdb` binary from [here](https://github.com/francis-du/iotdb-cli/releases/latest/).
36+
```shell
37+
curl -s https://raw.githubusercontent.com/francis-du/iotdb-cli/main/install.sh | sh
38+
39+
curl -s https://raw.githubusercontent.com/francis-du/iotdb-cli/main/install.sh | sh -s -- x.x.x
40+
```
41+
42+
```shell
43+
wget -qO- https://raw.githubusercontent.com/francis-du/iotdb-cli/main/install.sh | sh
44+
45+
wget -qO- https://raw.githubusercontent.com/francis-du/iotdb-cli/main/install.sh | sh -s -- x.x.x
46+
```
3747

3848
## Usage
3949

docs/src/get-started.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,19 @@ cargo install -f iotdb-cli
3131
cargo install -f --git https://github.com/francis-du/iotdb-cli.git
3232
```
3333

34-
2. From binary
34+
2. From [binary](https://github.com/francis-du/iotdb-cli/releases/latest)
3535

36-
Download latest `iotdb` binary from [here](https://github.com/francis-du/iotdb-cli/releases/latest/).
36+
```shell
37+
curl -s https://raw.githubusercontent.com/francis-du/iotdb-cli/main/install.sh | sh
38+
39+
curl -s https://raw.githubusercontent.com/francis-du/iotdb-cli/main/install.sh | sh -s -- x.x.x
40+
```
41+
42+
```shell
43+
wget -qO- https://raw.githubusercontent.com/francis-du/iotdb-cli/main/install.sh | sh
44+
45+
wget -qO- https://raw.githubusercontent.com/francis-du/iotdb-cli/main/install.sh | sh -s -- x.x.x
46+
```
3747

3848
## Usage
3949

install.sh

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ NO_COLOR=$'\e[0m'
44
ERROR=$'\e[0;31m'"ERROR: "
55
INFO=$'\e[0;32m'"INFO: "
66
WARN=$'\e[0;33m'"WARN: "
7+
LATEST="https://github.com/francis-du/iotdb-cli/releases/latest"
78
LATEST_RELEASE="https://api.github.com/repos/francis-du/iotdb-cli/releases/latest"
89
BIN_PATH="/usr/local/bin"
910
VERSION=$1
@@ -68,7 +69,7 @@ download() {
6869
exit 1
6970
fi
7071
else
71-
echo "${ERROR}Please install wget or curl${NO_COLOR}"
72+
echo "${ERROR}Please install 'wget' or 'curl'"
7273
exit 1
7374
fi
7475
fi
@@ -77,13 +78,13 @@ download() {
7778
function install() {
7879
set_version
7980
echo "${INFO}Version: ${VERSION}"
80-
echo "${INFO}Download from '${LATEST_RELEASE}'"
81+
echo "${INFO}Latest release '${LATEST}'"
8182
asset_base_url="https://github.com/francis-du/iotdb-cli/releases/download/${VERSION}"
8283
case "$(uname -s)" in
8384
Linux*)
8485
bin_name="${BIN_PATH}/iotdb"
8586
asset_url="$asset_base_url/iotdb-linux"
86-
echo "${INFO}Assert url '${asset_url}'"
87+
echo "${INFO}Download from '${asset_url}'"
8788
download $asset_url $bin_name
8889

8990
if [ -f "${bin_name}" ]; then
@@ -96,7 +97,7 @@ function install() {
9697
Darwin*)
9798
bin_name="${BIN_PATH}/iotdb"
9899
asset_url="${asset_base_url}/iotdb-mac"
99-
echo "${INFO}Assert url '${asset_url}'"
100+
echo "${INFO}Download from '${asset_url}'"
100101
download $asset_url $bin_name
101102

102103
if [ -f "${bin_name}" ]; then
@@ -110,7 +111,7 @@ function install() {
110111
# TODO: Need to be test
111112
bin_name="${BIN_PATH}/iotdb.exe"
112113
asset_url="$asset_base_url/iotdb.exe"
113-
echo "${INFO}Assert url '${asset_url}'"
114+
echo "${INFO}Download from '${asset_url}'"
114115
download $asset_url $bin_name
115116

116117
if [ -f "${bin_name}" ]; then
@@ -123,7 +124,7 @@ function install() {
123124
# TODO: Need to be test
124125
bin_name="${BIN_PATH}/iotdb.exe"
125126
asset_url=$asset_base_url"/iotdb.exe"
126-
echo "${INFO}Assert url '${asset_url}'"
127+
echo "${INFO}Download from '${asset_url}'"
127128
download $asset_url $bin_name
128129

129130
if [ -f "${bin_name}" ]; then

0 commit comments

Comments
 (0)