diff --git a/CHANGELOG b/CHANGELOG index 8b13789..4ad0473 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1 +1,3 @@ - +v1.0.4 +### Version 1.0.4 +- Create install script for MacOS diff --git a/install.sh b/install.sh index 01f779d..4847375 100755 --- a/install.sh +++ b/install.sh @@ -1,14 +1,33 @@ #!/bin/bash - -echo "Installing MicroGO binaries..." -wget https://github.com/cploutarchou/MicroGO/releases/download/v1.0.1/microGo userDir=$USER -echo "Enter your password to install MicroGO binaries using sudo" -sudo chmod +x microGo -sudo mv microGo /usr/local/bin/microGo # move to /usr/local/bin/microGo -echo "MicroGO binaries installed" -echo "Export env" -# shellcheck disable=SC2016 -echo 'export PATH=$PATH:/usr/local/bin/microGo' >>/home/"$userDir"/.bashrc -echo "MicroGO binaries exported to PATH" -source /home/"$userDir"/.bashrc +echo "Installing MicroGO binaries..." +curl -LJO https://github.com/cploutarchou/MicroGO/releases/download/v1.0.3/microGo +if [[ "$OSTYPE" == "linux-gnu"* ]]; then + if grep -q "alias microGo" ~/.zprofile; then + echo "Already exported" + else + sudo mv microGo /usr/local/bin/microGo + chmod +x /usr/local/bin/microGo + echo 'export PATH=$PATH:/usr/local/bin/microGo' >>/home/"$userDir"/.bashrc + echo "MicroGO binaries exported to PATH" + source /home/"$userDir"/.bashrc + fi +elif [[ "$OSTYPE" == "darwin"* ]]; then + mv microGo /Users/$userDir/go/bin/microGo + echo "Enter your password to install MicroGO binaries using sudo" + chmod +x /Users/$userDir/go/bin/microGo # move to /usr/local/bin/microGo + echo "MicroGO binaries installed" + echo "Export env" + if grep -q "alias microGo" ~/.zprofile; then + echo "Already exported" + else + source ~/.zprofile + comm="alias microGo=/Users/$userDir/go/bin/microGo" + echo $comm >>/Users/"$userDir"/.zprofile # add to .zprofile + echo "MicroGO binaries exported to PATH" + source ~/.zprofile + fi +else + + echo "Unsupported OS" +fi diff --git a/microGo.go b/microGo.go index c716733..8b1ecb2 100644 --- a/microGo.go +++ b/microGo.go @@ -24,7 +24,7 @@ import ( "github.com/robfig/cron/v3" ) -const version = "1.0.3" +const version = "1.0.4" var ( redisCache *cache.RedisCache