plasma5: Fix setup hook some more
1. `[[...]]` is more robust wrt empty expansions than `[..]` 2. `${foo-}` is simpler and won't accidentally be a url compared to `${foo:-}` 3. `+=` works even when the variable is undefined.
This commit is contained in:
parent
013b9a853b
commit
b45938a972
@ -43,11 +43,11 @@ let
|
|||||||
propagate = out:
|
propagate = out:
|
||||||
let setupHook = { writeScript }:
|
let setupHook = { writeScript }:
|
||||||
writeScript "setup-hook" ''
|
writeScript "setup-hook" ''
|
||||||
if [ "''${hookName:-}" != postHook ]; then
|
if [[ "''${hookName-}" != postHook ]]; then
|
||||||
postHooks+=("source @dev@/nix-support/setup-hook")
|
postHooks+=("source @dev@/nix-support/setup-hook")
|
||||||
else
|
else
|
||||||
# Propagate $${out} output
|
# Propagate $${out} output
|
||||||
propagatedUserEnvPkgs="$propagatedUserEnvPkgs @${out}@"
|
propagatedUserEnvPkgs+=" @${out}@"
|
||||||
|
|
||||||
if [ -z "$outputDev" ]; then
|
if [ -z "$outputDev" ]; then
|
||||||
echo "error: \$outputDev is unset!" >&2
|
echo "error: \$outputDev is unset!" >&2
|
||||||
@ -57,7 +57,7 @@ let
|
|||||||
# Propagate $dev so that this setup hook is propagated
|
# Propagate $dev so that this setup hook is propagated
|
||||||
# But only if there is a separate $dev output
|
# But only if there is a separate $dev output
|
||||||
if [ "$outputDev" != out ]; then
|
if [ "$outputDev" != out ]; then
|
||||||
propagatedBuildInputs="$propagatedBuildInputs @dev@"
|
propagatedBuildInputs+=" @dev@"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
'';
|
'';
|
||||||
|
Loading…
x
Reference in New Issue
Block a user