home-manager: present news even if assertion failed
This commit is contained in:
parent
07b4228988
commit
cda222d2ec
2 changed files with 25 additions and 16 deletions
|
|
@ -73,9 +73,10 @@ function doBuildAttr() {
|
|||
--argstr confAttr "$HOME_MANAGER_CONFIG_ATTRIBUTE"
|
||||
}
|
||||
|
||||
# Presents news to the user. Takes as argument the path to a "news
|
||||
# info" file as generated by `buildNews`.
|
||||
function presentNews() {
|
||||
local infoFile
|
||||
infoFile=$(buildNews) || return 1
|
||||
local infoFile="$1"
|
||||
|
||||
# shellcheck source=/dev/null
|
||||
. "$infoFile"
|
||||
|
|
@ -111,11 +112,22 @@ function presentNews() {
|
|||
}
|
||||
|
||||
function doBuild() {
|
||||
doBuildAttr -A activationPackage
|
||||
presentNews
|
||||
local newsInfo
|
||||
newsInfo=$(buildNews)
|
||||
|
||||
local exitCode
|
||||
doBuildAttr -A activationPackage \
|
||||
&& exitCode=0 || exitCode=1
|
||||
|
||||
presentNews "$newsInfo"
|
||||
|
||||
return $exitCode
|
||||
}
|
||||
|
||||
function doSwitch() {
|
||||
local newsInfo
|
||||
newsInfo=$(buildNews)
|
||||
|
||||
local generation
|
||||
local exitCode=0
|
||||
local wrkdir
|
||||
|
|
@ -132,9 +144,7 @@ function doSwitch() {
|
|||
# running and $wrkdir is always removed.
|
||||
rm -r "$wrkdir"
|
||||
|
||||
if [[ $exitCode -eq 0 ]]; then
|
||||
presentNews
|
||||
fi
|
||||
presentNews "$newsInfo"
|
||||
|
||||
return $exitCode
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue