mirror of
https://github.com/nix-community/home-manager
synced 2024-11-14 23:29:46 +01:00
home-manager: make newsReadIdsFile more reliable
Specifically, avoid duplicate remove duplicate slashes in the
`news-read-ids` file path.
Also quote the use of `newsReadIdsFile` to reduce problems with
potential spaces.
(cherry picked from commit 0c5704ecee
)
This commit is contained in:
parent
d6bb9f934f
commit
86853e31dc
1 changed files with 7 additions and 3 deletions
|
@ -733,7 +733,11 @@ function newsReadIdsFile() {
|
||||||
touch "$path"
|
touch "$path"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "$path"
|
# Remove duplicate slashes in case $HOME or $XDG_DATA_HOME have a trailing
|
||||||
|
# slash. Double slashes causes Nix to error out with
|
||||||
|
#
|
||||||
|
# error: syntax error, unexpected PATH_END, expecting DOLLAR_CURLY".
|
||||||
|
echo "$path" | tr -s /
|
||||||
}
|
}
|
||||||
|
|
||||||
# Builds the Home Manager news data file.
|
# Builds the Home Manager news data file.
|
||||||
|
@ -768,7 +772,7 @@ function buildNews() {
|
||||||
done
|
done
|
||||||
|
|
||||||
local readIdsFile
|
local readIdsFile
|
||||||
readIdsFile=$(newsReadIdsFile)
|
readIdsFile="$(newsReadIdsFile)"
|
||||||
|
|
||||||
nix-instantiate \
|
nix-instantiate \
|
||||||
--no-build-output --strict \
|
--no-build-output --strict \
|
||||||
|
@ -787,7 +791,7 @@ function doShowNews() {
|
||||||
buildNews "$newsNixFile"
|
buildNews "$newsNixFile"
|
||||||
|
|
||||||
local readIdsFile
|
local readIdsFile
|
||||||
readIdsFile=$(newsReadIdsFile)
|
readIdsFile="$(newsReadIdsFile)"
|
||||||
|
|
||||||
local news
|
local news
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue