Skip to content
Permalink
Browse files

Check requirements before installation in `make init` (#654)

* Check requirements before installation in `make init`

* Make error messages more clear
  • Loading branch information...
yous authored and youknowone committed Oct 6, 2019
1 parent 492e487 commit 3634acd75b6cce2fe87f2e17372678dd45eb627e
Showing with 17 additions and 4 deletions.
  1. +17 −4 Makefile
@@ -13,11 +13,24 @@ format:
swiftformat OSXCore/ OSX/ GureumTests/ Preferences/ OSXTestApp/

brew-install:
@command -v brew >/dev/null || { echo 'Homebrew is not installed. See https://brew.sh'; exit 1; }
brew install shellcheck swiftformat
@command -v brew >/dev/null || { echo 'Error: Homebrew is not installed. See https://brew.sh'; exit 1; }
@if ! command -v shellcheck >/dev/null; then \
echo 'brew install shellcheck'; \
brew install shellcheck; \
fi
@if ! command -v swiftformat >/dev/null; then \
echo 'brew install swiftformat'; \
brew install swiftformat; \
fi

gem-install:
@echo 'gem install cocoapods xcpretty'
@gem install cocoapods xcpretty || { echo 'gem-install failed. Try sudo make gem-install.'; exit 1; }
@if ! command -v pod >/dev/null; then \
echo 'gem install cocoapods'; \
gem install cocoapods || { echo 'Error: gem-install failed. Try sudo make gem-install.'; exit 1; }; \
fi
@if ! command -v xcpretty >/dev/null; then \
echo 'gem install xcpretty'; \
gem install xcpretty || { echo 'Error: gem-install failed. Try sudo make gem-install.'; exit 1; }; \
fi

.PHONY: all init format brew-install gem-install

0 comments on commit 3634acd

Please sign in to comment.
You can’t perform that action at this time.