From d2bbcab233dabe3b04f8c3b94a947ec174540418 Mon Sep 17 00:00:00 2001 From: n-peugnet Date: Sat, 19 Dec 2020 19:52:59 +0100 Subject: run phpcbf and add fix target to Makefile --- Makefile | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index e3fc1ad..8f4ca9d 100644 --- a/Makefile +++ b/Makefile @@ -135,6 +135,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 +171,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 -- cgit v1.2.3 From f6cc150d7052751d5c226ff8050db90d57355ed7 Mon Sep 17 00:00:00 2001 From: n-peugnet Date: Sat, 19 Dec 2020 20:35:16 +0100 Subject: fix make dist --- Makefile | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 8f4ca9d..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)) -- cgit v1.2.3