Skip to content
Snippets Groups Projects
Commit d79a1c12 authored by Torsten Bögershausen's avatar Torsten Bögershausen
Browse files

RULES_E3/module_name_check: use `grep -q`

Asking grep to output stuff and the piping it to /dev/null can be done
better, use "grep -q".

From man grep:
    -q, --quiet, --silent
              Quiet; do not write anything to standard output.
              Exit immediately with zero status if any match is found,
              even if  an  error was detected.
              Also see the -s or --no-messages option.

While there, remove the redirection of stderr.
It should be quiet anyway, and if there really is an error,
we want to see it.
This removes the "bash-istic" "&> /dev/null"
which is a non-portable version of >/dev/null 2>&1
parent 0805895b
No related branches found
No related tags found
No related merge requests found
......@@ -73,7 +73,7 @@ conf: module_name_check
## We should check that the module name satisfies a few conditions before we go on.
module_name_check:
ifneq ($(shell echo $(E3_MODULE_NAME) | grep '^[a-z_][a-z0-9_]\+$$' &> /dev/null; echo $$?),0)
ifneq ($(shell echo $(E3_MODULE_NAME) | grep -q '^[a-z_][a-z0-9_]\+$$' ; echo $$?),0)
$(error E3_MODULE_NAME '$(E3_MODULE_NAME)' is not valid. It should consist only of lowercase letters, numbers, and underscores.)
endif
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment