1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-12-11 19:41:08 +01:00

Avoid undefined variables in activation script

This commit is contained in:
Robert Helgesson 2017-03-29 00:10:30 +02:00
parent fea693ba16
commit 4f1eec8180
No known key found for this signature in database
GPG key ID: C3DB11069E65DC86
3 changed files with 17 additions and 8 deletions

View file

@ -281,7 +281,7 @@ in
}
function cleanOldGen() {
if [[ -z "$oldGenPath" ]] ; then
if [[ ! -v oldGenPath ]] ; then
return
fi
@ -294,7 +294,7 @@ in
| xargs -0 bash ${cleanup} "$newGenFiles" "$oldGenFiles"
}
if [[ "$oldGenPath" != "$newGenPath" ]] ; then
if [[ ! -v oldGenPath || "$oldGenPath" != "$newGenPath" ]] ; then
$DRY_RUN_CMD ln -Tsf $VERBOSE_ARG "$newGenPath" "$newGenProfilePath"
$DRY_RUN_CMD ln -Tsf $VERBOSE_ARG "$newGenProfilePath" "$genProfilePath"
$DRY_RUN_CMD ln -Tsf $VERBOSE_ARG "$newGenPath" "$newGenGcPath"