Installs in the same place as homebrew

This commit is contained in:
robocopAlpha 2020-08-04 13:48:20 +03:00
parent f67e850575
commit 6889284f6b

View file

@ -1,16 +1,19 @@
#!/bin/bash #!/bin/bash
BREWLOCATION=$(command -v brew) BREWLOCATION=$(command -v brew)
echo "$BREWLOCATION/brewlog"
if [ "$?" -ne "0" ]; then if [ "$?" -ne "0" ]; then
echo "Homebrew/Linux brew installation not detected in your PATH." echo "Homebrew/Linux brew installation not detected in your PATH."
exit 1 exit 1
else else
BREWLOCATION= $(dirname "$BREWLOCATION") BREWLOCATION=$(dirname "$BREWLOCATION")
echo "Determined installation location: $BREWLOCATION/brewlog"
fi fi
if [ -w /usr/local/bin ]; then if [ -w /usr/local/bin ]; then
curl -sSL 'https://raw.githubusercontent.com/robocopAlpha/brewlog/master/brewlog.sh' > $BREWLOCATION/brewlog curl -sSL 'https://raw.githubusercontent.com/robocopAlpha/brewlog/master/brewlog.sh' > $BREWLOCATION/brewlog
chmod +x $BREWLOCATION/brewlog chmod +x $BREWLOCATION/brewlog
printf "
brewlog has been installed as $(command -v brewlog).
You can start with brewlog --help %s\n"
else else
curl -sSL 'https://raw.githubusercontent.com/robocopAlpha/brewlog/master/brewlog.sh' >| brewlog.sh curl -sSL 'https://raw.githubusercontent.com/robocopAlpha/brewlog/master/brewlog.sh' >| brewlog.sh
echo "user $(whoami) cannot write to $BREWLOCATION" echo "user $(whoami) cannot write to $BREWLOCATION"