Skip to content

Instantly share code, notes, and snippets.

@zot24
Last active April 9, 2019 08:09
Show Gist options
  • Save zot24/48877603e613ae81d11a83e9e7c59aca to your computer and use it in GitHub Desktop.
Save zot24/48877603e613ae81d11a83e9e7c59aca to your computer and use it in GitHub Desktop.
Nested if's on a Makefile
.PHONY: deploy
deploy: ## deploy app
@if [[ $(ENVIRONMENT) == "development" ]]; then \
if [[ ! -f .built ]]; then \
$(MAKE) build; \
fi; \
if [[ ! -f .import ]]; then \
$(MAKE) import; \
fi; \
if [[ ! -f .migrate ]]; then \
$(MAKE) migrate; \
fi; \
fi; \
\
./bin/deploy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment