From 81a1d4594b6d14faf56a54332abcb7b7a6c0f8c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrei=20Mih=C4=83il=C4=83?= Date: Thu, 13 Oct 2022 18:51:47 +0300 Subject: [PATCH 1/2] fix: some compatibility issues with non GNU environments refs #17 --- plugins.mk | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/plugins.mk b/plugins.mk index 33d4aca..9abedc4 100644 --- a/plugins.mk +++ b/plugins.mk @@ -46,12 +46,13 @@ endif cd elvis-$(ELVIS_VERSION) && \ $(ELVIS_REBAR3) escriptize $(gen_verbose) cp $(ELVIS_BUILD_DIR)/elvis-$(ELVIS_VERSION)/_build/default/bin/elvis $(ELVIS) - $(gen_verbose) cp --no-clobber $(ELVIS_BUILD_DIR)/elvis-$(ELVIS_VERSION)/elvis.config $(ELVIS_CONFIG) + $(gen_verbose) [ -e $(ELVIS_CONFIG) ] || \ + cp -n $(ELVIS_BUILD_DIR)/elvis-$(ELVIS_VERSION)/elvis.config $(ELVIS_CONFIG) $(verbose) chmod +x $(ELVIS) $(verbose) rm -rf $(ELVIS_BUILD_DIR)/elvis-$(ELVIS_VERSION) $(verbose) rm $(ELVIS_BUILD_DIR)/$(ELVIS_CODE_ARCHIVE) - $(verbose) rm --force $(ELVIS_BUILD_DIR)/rebar3 - $(verbose) rmdir --ignore-fail-on-non-empty $(ELVIS_BUILD_DIR) + $(verbose) rm -f $(ELVIS_BUILD_DIR)/rebar3 + $(verbose) [ -z "$(ls -A $(ELVIS_BUILD_DIR))" ] || rmdir $(ELVIS_BUILD_DIR) elvis: $(ELVIS) $(verbose) $(ELVIS) rock -c $(ELVIS_CONFIG) $(ELVIS_OPTS) From 5350d3063b2abf9519c30e5d620ac3617c0dbbfc Mon Sep 17 00:00:00 2001 From: Roger Lipscombe Date: Wed, 19 Oct 2022 09:43:14 +0100 Subject: [PATCH 2/2] fix: some compatibility issues with non GNU environments Change the test for empty directory to match one that erlang.mk uses itself, for consistency. refs #17 --- plugins.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins.mk b/plugins.mk index 9abedc4..a27655d 100644 --- a/plugins.mk +++ b/plugins.mk @@ -52,7 +52,7 @@ endif $(verbose) rm -rf $(ELVIS_BUILD_DIR)/elvis-$(ELVIS_VERSION) $(verbose) rm $(ELVIS_BUILD_DIR)/$(ELVIS_CODE_ARCHIVE) $(verbose) rm -f $(ELVIS_BUILD_DIR)/rebar3 - $(verbose) [ -z "$(ls -A $(ELVIS_BUILD_DIR))" ] || rmdir $(ELVIS_BUILD_DIR) + $(if $(shell ls -A $(ELVIS_BUILD_DIR)/),,$(verbose) rmdir $(ELVIS_BUILD_DIR)) elvis: $(ELVIS) $(verbose) $(ELVIS) rock -c $(ELVIS_CONFIG) $(ELVIS_OPTS)