Skip to content

Instantly share code, notes, and snippets.

@theothermutahhir
Last active March 4, 2022 06:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save theothermutahhir/34f7168f5f5f1b83022b223d8b679735 to your computer and use it in GitHub Desktop.
Save theothermutahhir/34f7168f5f5f1b83022b223d8b679735 to your computer and use it in GitHub Desktop.
Install dependencies script for reread
#!/bin/bash
set -eo pipefail
echo ""
echo "Installing common dependencies"
echo ""
if ! $(command -v brew &> /dev/null); then
echo "Installing Homebrew"
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
else
echo "Homebrew installed, updating"
brew update
fi
echo "Installing Docker"
if ! $(command -v docker &> /dev/null); then
brew install docker
else
brew upgrade docker
fi
echo "Docker installed"
echo ""
echo "Installing Server Dependencies"
echo ""
if ! $(command -v go &> /dev/null); then
brew install go
else
brew upgrade go
fi
if ! $(command -v golangci-lint &> /dev/null); then
brew install golangci-lint
brew upgrade golangci-lint
else
brew upgrade golangci-lint
fi
if ! $(command -v air &> /dev/null); then
curl -sSfL \
https://raw.githubusercontent.com/cosmtrek/air/master/install.sh \
| bash -s -- -b $(go env GOPATH)/bin
else
echo "Air installed"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment