aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorVincent Peugnet <33429034+vincent-peugnet@users.noreply.github.com>2020-12-22 12:35:31 +0100
committerGitHub <noreply@github.com>2020-12-22 12:35:31 +0100
commitf30ec46d410f4c0bf986929e132f8a9efd4d0530 (patch)
tree9baaa6e940c85e018273a48b410e24c94e32d8fb /Makefile
parent8a8aebc3606c9ad7a59c93df90b2e591709bb717 (diff)
parentf6cc150d7052751d5c226ff8050db90d57355ed7 (diff)
downloadwcms-f30ec46d410f4c0bf986929e132f8a9efd4d0530.tar.gz
wcms-f30ec46d410f4c0bf986929e132f8a9efd4d0530.zip
Merge pull request #130 from n-peugnet/deps
build(deps): fix github ci
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile17
1 files changed, 14 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index e3fc1ad..13afc14 100644
--- a/Makefile
+++ b/Makefile
@@ -6,10 +6,15 @@ build_dir := build
js_src_dir := src
# Misc variables.
-PATH := vendor/bin:node_modules/.bin:$(PATH)
+export PATH := vendor/bin:node_modules/.bin:$(PATH)
ifneq ($(OS),Windows_NT) # Not for Windows
- SHELL := PATH=$(PATH) /bin/bash
+UNAME_S := $(shell uname -s)
+ifeq ($(UNAME_S),Darwin) # For Mac
+SHELL := PATH=$(PATH) /bin/bash
+else
+SHELL := /bin/bash
+endif
endif
override GIT_VERSION := $(shell git --no-pager describe --always --tags)
override CUR_VERSION := $(strip $(shell cat VERSION 2>/dev/null))
@@ -135,6 +140,7 @@ endif
vendor: composer.json composer.lock
@echo Installing PHP dependencies...
composer install $(COMPOSER_FLAGS)
+ touch $@
# Install JS dependencies.
node_modules: package.json package-lock.json
@@ -170,7 +176,12 @@ check: vendor lint analyse test
# Lint php code with phpcs.
.PHONY: lint
lint: $(phpcs_dir)
- phpcs --report-full --report-summary --cache=$(phpcs_dir)/result.cache
+ phpcs --report-full --report-summary --cache=$(phpcs_dir)/result.cache || printf "run 'make fix'\n\n"; exit 1
+
+# fix php code with phpcbf.
+.PHONY: fix
+fix: $(phpcs_dir)
+ phpcbf || exit 0
# Analyse php code with phpstan.
.PHONY: analyse