Skip to content

Commit

Permalink
Merge pull request #136 from netgen/NGGW-116-check-stash
Browse files Browse the repository at this point in the history
NGGW-116 check if there is anything to stash first
  • Loading branch information
emodric authored Mar 6, 2023
2 parents aacb066 + d547e07 commit a0672bb
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ ifeq ("$(wildcard $(COMPOSER_PATH))","")
endif
COMPOSER_RUN = $(PHP_RUN) $(COMPOSER_PATH)
CACHE_POOL = cache.redis
STASH_HASH := $(shell git stash create)

.PHONY: help
help: ## List of all available commands
Expand Down Expand Up @@ -87,9 +88,15 @@ endif
@$(MAKE) -s graphql-schema
@$(MAKE) -s clear-cache

.PHONY: update-code
update-code: ## Pull the latest code from the repository (on the current branch)
ifeq ($(STASH_HASH),)
git pull --rebase
else
git stash && git pull --rebase && git stash pop
endif

.PHONY: refresh
refresh: ## Fetch latest changes and build the project for specified environment (default: SYMFONY_ENV=dev)
/usr/bin/env git stash
/usr/bin/env git pull --rebase
/usr/bin/env git stash pop
@$(MAKE) -s update-code
@$(MAKE) -s build

0 comments on commit a0672bb

Please sign in to comment.