$VERBOSE_ECHO"Sanity checking oldGenNum and oldGenPath"
$VERBOSE_RUN _i"Sanity checking oldGenNum and oldGenPath"
if[[ -v oldGenNum && ! -v oldGenPath
|| ! -v oldGenNum && -v oldGenPath ]];then
errorEcho "Invalid profile number and current profile values! These"
errorEcho "must be either both empty or both set but are now set to"
errorEcho " '${oldGenNum:-}' and '${oldGenPath:-}'"
errorEcho "If you don't mind losing previous profile generations then"
errorEcho "the easiest solution is probably to run"
errorEcho " rm $profilesPath/home-manager*"
errorEcho " rm $gcPath/current-home"
errorEcho "and trying home-manager switch again. Good luck!"
_i $'The previous generation number and path are in conflict! These\nmust be either both empty or both set but are now set to\n\n \'%s\' and \'%s\'\n\nIf you don\'t mind losing previous profile generations then\nthe easiest solution is probably to run\n\n rm %s/home-manager*\n rm %s/current-home\n\nand trying home-manager switch again. Good luck!'\
"${oldGenNum:-}""${oldGenPath:-}"\
"$profilesPath""$gcPath"
exit1
fi
}
@ -45,34 +40,35 @@ function setupVars() {
if[[ -v VERBOSE ]];then
exportVERBOSE_ECHO=echo
exportVERBOSE_ARG="--verbose"
exportVERBOSE_RUN=""
else
exportVERBOSE_ECHO=true
exportVERBOSE_ARG=""
exportVERBOSE_RUN=true
fi
_i "Starting Home Manager activation"
# Verify that we can connect to the Nix store and/or daemon. This will
# also create the necessary directories in profiles and gcroots.