Skip to content

Commit 3f1b001

Browse files
committed
♿ Add a shell script to install
1 parent 9e7f65b commit 3f1b001

File tree

2 files changed

+41
-1
lines changed

2 files changed

+41
-1
lines changed

scripts/command-test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env bash
22

3-
set -e
3+
set -euo pipefail
44

55
MOD="github.com/eat-pray-ai/yutu/cmd"
66
Version="${MOD}.Version=$(git describe --tags --always --dirty | cut -c2-)"

scripts/install.sh

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
#!/usr/bin/env bash
2+
3+
set -euo pipefail
4+
5+
REPO="github.com/eat-pray-ai/yutu"
6+
7+
ARCH="UNKNOWN"
8+
case $(uname -m) in
9+
x86_64 | amd64) ARCH="amd64" ;;
10+
aarch64 | arm64) ARCH="arm64" ;;
11+
esac
12+
13+
if [[ "${ARCH}" == "UNKNOWN" ]]; then
14+
echo "Unlisted architecture: $(uname -m)"
15+
echo "Please create an issue at ${REPO}/issues"
16+
exit 1
17+
fi
18+
19+
OS="UNKNOWN"
20+
case $(uname -s) in
21+
Linux) OS="linux" ;;
22+
Darwin) OS="darwin" ;;
23+
esac
24+
25+
if [[ "${OS}" == "UNKNOWN" ]]; then
26+
echo "Unlisted OS: $(uname -s)"
27+
echo "Please create an issue at ${REPO}/issues"
28+
exit 1
29+
fi
30+
31+
FILE="yutu-${OS}-${ARCH}"
32+
curl -sSfL https://${REPO}/releases/latest/download/${FILE} -o ./yutu
33+
chmod +x ./yutu
34+
./yutu version
35+
36+
echo """
37+
yutu🐰 is downloaded to the current directory.
38+
You may want to move it to a directory in your PATH, e.g.:
39+
sudo mv ./yutu /usr/local/bin/yutu
40+
"""

0 commit comments

Comments
 (0)