Skip to content

Commit

Permalink
♿ Add a shell script to install
Browse files Browse the repository at this point in the history
  • Loading branch information
OpenWaygate committed Dec 30, 2024
1 parent 9e7f65b commit 3f1b001
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/command-test.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

set -e
set -euo pipefail

MOD="github.com/eat-pray-ai/yutu/cmd"
Version="${MOD}.Version=$(git describe --tags --always --dirty | cut -c2-)"
Expand Down
40 changes: 40 additions & 0 deletions scripts/install.sh
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
"""

0 comments on commit 3f1b001

Please sign in to comment.