mirror of
https://github.com/nix-community/home-manager
synced 2024-11-27 05:29:46 +01:00
home-manager: minor news build cleanups
- Rename the build function. - Specify the built attribute in the build function. - Make the news build silent.
This commit is contained in:
parent
9c1b3735b4
commit
ad1eee7aa5
1 changed files with 11 additions and 4 deletions
|
@ -75,7 +75,7 @@ function doBuildAttr() {
|
||||||
|
|
||||||
function presentNews() {
|
function presentNews() {
|
||||||
local infoFile
|
local infoFile
|
||||||
infoFile=$(doBuildNews -A newsInfo) || return 1
|
infoFile=$(buildNews) || return 1
|
||||||
|
|
||||||
# shellcheck source=/dev/null
|
# shellcheck source=/dev/null
|
||||||
. "$infoFile"
|
. "$infoFile"
|
||||||
|
@ -170,8 +170,15 @@ function newsReadIdsFile() {
|
||||||
echo "$path"
|
echo "$path"
|
||||||
}
|
}
|
||||||
|
|
||||||
function doBuildNews() {
|
# Builds news meta information to be sourced into this script.
|
||||||
doBuildAttr "$*" \
|
#
|
||||||
|
# Note, we suppress build output to remove unnecessary verbosity. We
|
||||||
|
# also use "no out link" to avoid the need for a build directory
|
||||||
|
# (although this exposes the risk of GC removing the result before we
|
||||||
|
# manage to source it).
|
||||||
|
function buildNews() {
|
||||||
|
doBuildAttr --quiet \
|
||||||
|
--attr newsInfo \
|
||||||
--no-out-link \
|
--no-out-link \
|
||||||
--arg check false \
|
--arg check false \
|
||||||
--argstr newsReadIdsFile "$(newsReadIdsFile)"
|
--argstr newsReadIdsFile "$(newsReadIdsFile)"
|
||||||
|
@ -179,7 +186,7 @@ function doBuildNews() {
|
||||||
|
|
||||||
function doShowNews() {
|
function doShowNews() {
|
||||||
local infoFile
|
local infoFile
|
||||||
infoFile=$(doBuildNews -A newsInfo) || return 1
|
infoFile=$(buildNews) || return 1
|
||||||
|
|
||||||
# shellcheck source=/dev/null
|
# shellcheck source=/dev/null
|
||||||
. "$infoFile"
|
. "$infoFile"
|
||||||
|
|
Loading…
Reference in a new issue