startup scripts: get rid of $* and replace it with properly quoted "$@"

In shell scripts an unquoted $* is rarely useful, for example because it breaks
in presence of file names with spaces.

References:
- https://google.github.io/styleguide/shell.xml
  Use "$@" unless you have a specific reason to use $*.

- https://unix.stackexchange.com/questions/41571/what-is-the-difference-between-and#94200
  Short answer: use "$@" (note the double quotes). The other forms are very
  rarely useful.
This commit is contained in:
muxator 2019-12-01 01:52:32 +01:00
parent 695c2d2e84
commit 0a86024797
4 changed files with 8 additions and 8 deletions

View file

@ -83,7 +83,7 @@ require_minimal_version "nodejs" "$NODE_VERSION_STRING" "$REQUIRED_NODE_MAJOR" "
#Get the name of the settings file
settings="settings.json"
a='';
for arg in $*; do
for arg in "$@"; do
if [ "$a" = "--settings" ] || [ "$a" = "-s" ]; then settings=$arg; fi
a=$arg
done