home-environment: always link new and clean old generation

Previously the home files were not linked if the generation hadn't
changed. Unfortunately, this would mean that, if a file link was
removed for some reason it would not be recreated by running a switch
command.
This commit is contained in:
Robert Helgesson 2017-05-06 00:35:36 +02:00
parent 8fab2a5d9b
commit 7e58b6bb35
No known key found for this signature in database
GPG key ID: C3DB11069E65DC86

View file

@ -300,14 +300,16 @@ in
}
if [[ ! -v oldGenPath || "$oldGenPath" != "$newGenPath" ]] ; then
echo "Creating profile generation $newGenNum"
$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"
linkNewGen
cleanOldGen
else
echo "Same home files as previous generation ... doing nothing"
echo "No change so reusing latest profile generation $oldGenNum"
fi
linkNewGen
cleanOldGen
''
);