setup: quote variables in checks
Without "" around the variable, if they are unset, no string is visible to bash and the test incorrectly passes.
This commit is contained in:
parent
fa5e1dc516
commit
cf6cc693aa
4
setup
4
setup
|
@ -48,8 +48,8 @@ initial_settings_yml() {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
[ -n ${template} ] || usage "ERROR: Missing pipeline template type" 1
|
[ -n "${template}" ] || usage "ERROR: Missing pipeline template type" 1
|
||||||
[ -d ${target} ] || usage "ERROR: ${target} path not found" 1
|
[ -d "${target}" ] || usage "ERROR: ${target} path not found" 1
|
||||||
|
|
||||||
pattern="^($(echo "$pipeline_types" | tr "\n" "|" | sed -e "s/\|*$//"))$"
|
pattern="^($(echo "$pipeline_types" | tr "\n" "|" | sed -e "s/\|*$//"))$"
|
||||||
[[ "${template}"=~$pattern ]] || usage "ERROR: ${template} is not a valid pipeline template" 1
|
[[ "${template}"=~$pattern ]] || usage "ERROR: ${template} is not a valid pipeline template" 1
|
||||||
|
|
Loading…
Reference in New Issue