mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-21 22:43:01 +00:00
pkgs/stdenv/generic/setup.sh: lint with ShellCheck (#351849)
This commit is contained in:
commit
f2b00cb5ef
@ -15,6 +15,7 @@ shopt -s inherit_errexit
|
||||
# $NIX_DEBUG must be a documented integer level, if set, so we can use it safely as an integer.
|
||||
# See the `Verbosity` enum in the Nix source for these levels.
|
||||
if ! [[ -z ${NIX_DEBUG-} || $NIX_DEBUG == [0-7] ]]; then
|
||||
# shellcheck disable=SC2016
|
||||
printf 'The `NIX_DEBUG` environment variable has an unexpected value: %s\n' "${NIX_DEBUG}"
|
||||
echo "It can only be unset or an integer between 0 and 7."
|
||||
exit 1
|
||||
@ -396,7 +397,7 @@ concatTo() {
|
||||
for arg in "$@"; do
|
||||
IFS="=" read -r name default <<< "$arg"
|
||||
local -n nameref="$name"
|
||||
if [[ ! -n "${nameref[@]}" && -n "$default" ]]; then
|
||||
if [[ -z "${nameref[*]}" && -n "$default" ]]; then
|
||||
targetref+=( "$default" )
|
||||
elif type=$(declare -p "$name" 2> /dev/null); then
|
||||
case "${type#* }" in
|
||||
|
Loading…
Reference in New Issue
Block a user