-
-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: Add installation steps + script
- Loading branch information
Showing
2 changed files
with
27 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,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/darktile/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 /tmp/darktile | ||
echo "Installing darktile..." | ||
chmod +x /tmp/darktile | ||
installdir="${HOME}/bin/" | ||
if [ "$EUID" -eq 0 ]; then | ||
installdir="/usr/local/bin/" | ||
fi | ||
mkdir -p $installdir | ||
mv /tmp/darktile "${installdir}/darktile" | ||
which darktile &> /dev/null || (echo "Please add ${installdir} to your PATH to complete installation!" && exit 1) | ||
echo "Installation complete!" |