Skip to content

Commit

Permalink
Use grep to check a regular expression.
Browse files Browse the repository at this point in the history
[[ is a bash/zsh-ism that does not exist in the POSIX /bin/sh, and by
default, GNU make (perhaps others) uses /bin/sh as its shell.  On
systems where /bin/sh is a POSIX-compliant shell, the [[ test fails.

This addresses issue #243.
  • Loading branch information
Chris Spiegel committed Apr 9, 2013
1 parent 6bc440a commit db50f97
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Makefile
Expand Up @@ -22,7 +22,7 @@ edoc:
#$(ERL) -pa ebin -noshell -eval "boss_doc:run()" -s init stop

app:
@(if [[ ! "$(PROJECT)" =~ ^[a-z]+[a-zA-Z0-9_@]*$$ ]] ; then echo "Project name should be a valid Erlang atom."; exit 1; fi)
@(if ! echo "$(PROJECT)" | grep -qE '^[a-z]+[a-zA-Z0-9_@]*$$'; then echo "Project name should be a valid Erlang atom."; exit 1; fi)
@$(REBAR) create template=skel dest=$(DEST) src=$(PWD) appid=$(PROJECT) skip_deps=true

get-deps:
Expand Down

0 comments on commit db50f97

Please sign in to comment.