aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2018-11-24 13:29:23 +0100
committerLoïc Hoguin <[email protected]>2018-11-24 13:29:23 +0100
commit9dfa5dd6fa860040b2711f09aed38d3a1ff606be (patch)
tree52b69c7c6d4f4c6a5fd31ad300705b152e2a17d0 /plugins
parentea066afe76802fb888abc58c1a4ac3d367e2379c (diff)
downloaderlang.mk-9dfa5dd6fa860040b2711f09aed38d3a1ff606be.tar.gz
erlang.mk-9dfa5dd6fa860040b2711f09aed38d3a1ff606be.tar.bz2
erlang.mk-9dfa5dd6fa860040b2711f09aed38d3a1ff606be.zip
Disallow uppercase characters in application names
Diffstat (limited to 'plugins')
-rw-r--r--plugins/bootstrap.mk12
1 files changed, 8 insertions, 4 deletions
diff --git a/plugins/bootstrap.mk b/plugins/bootstrap.mk
index cb459b2..84f168e 100644
--- a/plugins/bootstrap.mk
+++ b/plugins/bootstrap.mk
@@ -421,7 +421,8 @@ ifneq ($(wildcard src/),)
$(error Error: src/ directory already exists)
endif
$(eval p := $(PROJECT))
- $(if $(findstring -,$p),$(error Error: The dash cannot be used in application names))
+ $(if $(shell echo $p | grep -x "[a-z0-9_]*"),,\
+ $(error Error: Invalid characters in the application name))
$(eval n := $(PROJECT)_sup)
$(call render_template,bs_Makefile,Makefile)
$(verbose) echo "include erlang.mk" >> Makefile
@@ -437,7 +438,8 @@ ifneq ($(wildcard src/),)
$(error Error: src/ directory already exists)
endif
$(eval p := $(PROJECT))
- $(if $(findstring -,$p),$(error Error: The dash cannot be used in application names))
+ $(if $(shell echo $p | grep -x "[a-z0-9_]*"),,\
+ $(error Error: Invalid characters in the application name))
$(call render_template,bs_Makefile,Makefile)
$(verbose) echo "include erlang.mk" >> Makefile
$(verbose) mkdir src/
@@ -466,7 +468,8 @@ ifneq ($(wildcard $(APPS_DIR)/$in),)
$(error Error: Application $in already exists)
endif
$(eval p := $(in))
- $(if $(findstring -,$p),$(error Error: The dash cannot be used in application names))
+ $(if $(shell echo $p | grep -x "[a-z0-9_]*"),,\
+ $(error Error: Invalid characters in the application name))
$(eval n := $(in)_sup)
$(verbose) mkdir -p $(APPS_DIR)/$p/src/
$(call render_template,bs_apps_Makefile,$(APPS_DIR)/$p/Makefile)
@@ -484,7 +487,8 @@ ifneq ($(wildcard $(APPS_DIR)/$in),)
$(error Error: Application $in already exists)
endif
$(eval p := $(in))
- $(if $(findstring -,$p),$(error Error: The dash cannot be used in application names))
+ $(if $(shell echo $p | grep -x "[a-z0-9_]*"),,\
+ $(error Error: Invalid characters in the application name))
$(verbose) mkdir -p $(APPS_DIR)/$p/src/
$(call render_template,bs_apps_Makefile,$(APPS_DIR)/$p/Makefile)
ifdef LEGACY