installsh
This commit is contained in:
parent
5547123cce
commit
2177bc0ae4
|
@ -8,7 +8,6 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|
||||||
if len(os.Args) != 3 {
|
if len(os.Args) != 3 {
|
||||||
fmt.Println("Please specify font path and name")
|
fmt.Println("Please specify font path and name")
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
|
|
|
@ -1,20 +0,0 @@
|
||||||
#!/usr/bin/env 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!"
|
|
Loading…
Reference in New Issue