forked from liamg/gitjacker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
20 lines (18 loc) · 769 Bytes
/
install.sh
File metadata and controls
20 lines (18 loc) · 769 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/bash
set -e
echo "Determining platform..."
platform=$(uname | tr '[:upper:]' '[:lower:]')
echo "Finding latest release..."
asset=$(curl --silent https://api.github.com/repos/liamg/gitjacker/releases/latest | jq -r ".assets[] | select(.name | contains(\"${platform}\")) | .url")
echo "Downloading latest release for your platform..."
curl -s -L -H "Accept: application/octet-stream" "${asset}" --output ./gitjacker
echo "Installing gitjacker..."
chmod +x ./gitjacker
installdir="${HOME}/bin/"
if [ "$EUID" -eq 0 ]; then
installdir="/usr/local/bin/"
fi
mkdir -p $installdir
mv ./gitjacker "${installdir}/gitjacker"
which gitjacker &> /dev/null || (echo "Please add ${installdir} to your PATH to complete installation!" && exit 1)
echo "Installation complete!"