Skip to content

Commit 8f625c2

Browse files
committed
docs: 更新文档
1 parent 4adfa59 commit 8f625c2

4 files changed

Lines changed: 86 additions & 14 deletions

File tree

README.md

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,29 @@
4343
by [share121](https://github.com/share121), [Cyan](https://github.com/CyanChanges), and other contributors.
4444
- **💻 Cross-Platform**
4545

46-
## Download
46+
## Quick Install
47+
48+
### Linux & macOS
49+
50+
using curl:
51+
52+
```bash
53+
curl -fsSL https://raw.githubusercontent.com/fast-down/cli/refs/heads/main/scripts/install.sh | bash
54+
```
55+
56+
Or using wget:
57+
58+
```bash
59+
wget -qO- https://raw.githubusercontent.com/fast-down/cli/refs/heads/main/scripts/install.sh | bash
60+
```
61+
62+
### Windows
63+
64+
```powershell
65+
powershell -ExecutionPolicy ByPass -c "irm https://raw.githubusercontent.com/fast-down/cli/refs/heads/main/scripts/install.ps1 | iex"
66+
```
67+
68+
## Manual Download
4769

4870
| Architecture | Windows | Linux | Mac OS |
4971
| ------------ | ------------- | ------------- | ---------------- |

README.zhcn.md

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,29 @@
3939
所有代码全部公开,由 [share121](https://github.com/share121)[Cyan](https://github.com/CyanChanges) 与其他贡献者一起维护
4040
- **💻 跨平台**
4141

42-
## 下载
42+
## 快速安装
43+
44+
### Linux & macOS
45+
46+
使用 curl:
47+
48+
```bash
49+
curl -fsSL https://raw.githubusercontent.com/fast-down/cli/refs/heads/main/scripts/install.sh | bash
50+
```
51+
52+
或使用 wget:
53+
54+
```bash
55+
wget -qO- https://raw.githubusercontent.com/fast-down/cli/refs/heads/main/scripts/install.sh | bash
56+
```
57+
58+
### Windows
59+
60+
```powershell
61+
powershell -ExecutionPolicy ByPass -c "irm https://raw.githubusercontent.com/fast-down/cli/refs/heads/main/scripts/install.ps1 | iex"
62+
```
63+
64+
## 手动下载
4365

4466
| 架构 | Windows | Linux | Mac OS |
4567
| ------- | --------- | --------- | --------- |

README.zhtw.md

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,29 @@
3939
所有程式碼完全公開,由 [share121](https://github.com/share121)[Cyan](https://github.com/CyanChanges) 及其他貢獻者共同維護
4040
- **💻 跨平台支援**
4141

42-
## 下載
42+
## 快速安装
43+
44+
### Linux & macOS
45+
46+
使用 curl:
47+
48+
```bash
49+
curl -fsSL https://raw.githubusercontent.com/fast-down/cli/refs/heads/main/scripts/install.sh | bash
50+
```
51+
52+
或使用 wget:
53+
54+
```bash
55+
wget -qO- https://raw.githubusercontent.com/fast-down/cli/refs/heads/main/scripts/install.sh | bash
56+
```
57+
58+
### Windows
59+
60+
```powershell
61+
powershell -ExecutionPolicy ByPass -c "irm https://raw.githubusercontent.com/fast-down/cli/refs/heads/main/scripts/install.ps1 | iex"
62+
```
63+
64+
## 手動下載
4365

4466
| 架構 | Windows | Linux | Mac OS |
4567
| ------- | --------- | --------- | --------- |

scripts/install.sh

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,23 @@ trap 'rm -f "$TMP_FILE"' EXIT INT TERM
1212

1313
echo "✨ Downloading $DOWNLOAD_URL"
1414

15-
if command -v wget >/dev/null 2>&1; then
15+
if command -v curl >/dev/null 2>&1; then
16+
HTTP_STATUS=$(curl -L# --retry 3 --retry-delay 2 -w "%{http_code}" -o "$TMP_FILE" "$DOWNLOAD_URL")
17+
CURL_RET=$?
18+
if [ $CURL_RET -ne 0 ]; then
19+
echo "❌ Error: Curl command failed (Exit Code: $CURL_RET)"
20+
exit 1
21+
fi
22+
if [ "$HTTP_STATUS" != "200" ]; then
23+
if [ -s "$TMP_FILE" ]; then
24+
SERVER_MSG=$(cat "$TMP_FILE")
25+
echo "❌ Error: $SERVER_MSG (Platform: $PLATFORM, Arch: $ARCH, HTTP Status: $HTTP_STATUS)"
26+
else
27+
echo "❌ Error: Network request failed (Platform: $PLATFORM, Arch: $ARCH, HTTP Status: $HTTP_STATUS)"
28+
fi
29+
exit 1
30+
fi
31+
elif command -v wget >/dev/null 2>&1; then
1632
wget -q --show-progress --content-on-error -O "$TMP_FILE" "$DOWNLOAD_URL"
1733
WGET_STATUS=$?
1834
if [ $WGET_STATUS -ne 0 ]; then
@@ -24,16 +40,6 @@ if command -v wget >/dev/null 2>&1; then
2440
fi
2541
exit 1
2642
fi
27-
elif command -v curl >/dev/null 2>&1; then
28-
HTTP_STATUS=$(curl -# -L -w "%{http_code}" -o "$TMP_FILE" "$DOWNLOAD_URL" || echo "CURL_ERROR")
29-
if [ "$HTTP_STATUS" = "CURL_ERROR" ]; then
30-
echo "❌ Error: Network request failed (Platform: $PLATFORM, Arch: $ARCH)"
31-
exit 1
32-
elif [ "$HTTP_STATUS" != "200" ]; then
33-
SERVER_MSG=$(cat "$TMP_FILE")
34-
echo "❌ Error: $SERVER_MSG (Platform: $PLATFORM, Arch: $ARCH, HTTP Status: $HTTP_STATUS)"
35-
exit 1
36-
fi
3743
else
3844
echo "❌ Error: Neither 'curl' nor 'wget' is installed"
3945
echo "🔔 Please install curl or wget first, then run this script again"

0 commit comments

Comments
 (0)