-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
32 lines (23 loc) · 918 Bytes
/
install.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/sh
REPO="mitty1293/oboegaki"
BIN_NAME="obo"
LICENSE_NAME="LICENSE"
# Get the latest release version
VERSION=$(curl --silent "https://api.github.com/repos/$REPO/releases/latest" | jq -r .tag_name)
ZIP_NAME="obo_${VERSION}.zip"
# Create download URL
URL="https://github.com/$REPO/releases/download/$VERSION/$ZIP_NAME"
# Download the ZIP file
curl -L $URL -o /tmp/$ZIP_NAME
# Unzip the file
unzip /tmp/$ZIP_NAME -d /tmp/
# Move the binary to /usr/local/bin and make it executable
sudo mv /tmp/$BIN_NAME /usr/local/bin/$BIN_NAME
sudo chmod +x /usr/local/bin/$BIN_NAME
# Move the LICENSE file to /usr/local/share/licenses/oboegaki
sudo mkdir -p /usr/local/share/licenses/oboegaki
sudo mv /tmp/$LICENSE_NAME /usr/local/share/licenses/oboegaki/$LICENSE_NAME
# Clean up
rm /tmp/$ZIP_NAME
echo "$BIN_NAME has been installed to /usr/local/bin"
echo "LICENSE has been moved to /usr/local/share/licenses/oboegaki"