-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9e7f65b
commit 3f1b001
Showing
2 changed files
with
41 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -euo pipefail | ||
|
||
REPO="github.com/eat-pray-ai/yutu" | ||
|
||
ARCH="UNKNOWN" | ||
case $(uname -m) in | ||
x86_64 | amd64) ARCH="amd64" ;; | ||
aarch64 | arm64) ARCH="arm64" ;; | ||
esac | ||
|
||
if [[ "${ARCH}" == "UNKNOWN" ]]; then | ||
echo "Unlisted architecture: $(uname -m)" | ||
echo "Please create an issue at ${REPO}/issues" | ||
exit 1 | ||
fi | ||
|
||
OS="UNKNOWN" | ||
case $(uname -s) in | ||
Linux) OS="linux" ;; | ||
Darwin) OS="darwin" ;; | ||
esac | ||
|
||
if [[ "${OS}" == "UNKNOWN" ]]; then | ||
echo "Unlisted OS: $(uname -s)" | ||
echo "Please create an issue at ${REPO}/issues" | ||
exit 1 | ||
fi | ||
|
||
FILE="yutu-${OS}-${ARCH}" | ||
curl -sSfL https://${REPO}/releases/latest/download/${FILE} -o ./yutu | ||
chmod +x ./yutu | ||
./yutu version | ||
|
||
echo """ | ||
yutu🐰 is downloaded to the current directory. | ||
You may want to move it to a directory in your PATH, e.g.: | ||
sudo mv ./yutu /usr/local/bin/yutu | ||
""" |