mirror of
https://github.com/nix-community/home-manager.git
synced 2024-12-14 11:57:55 +00:00
home-environment: make getVersion more robust
This commit is contained in:
parent
d3f21617ac
commit
f67649307d
1 changed files with 9 additions and 1 deletions
|
@ -680,7 +680,15 @@ in
|
||||||
getVersion = pkgs.writeShellScript "get-hm-version" ''
|
getVersion = pkgs.writeShellScript "get-hm-version" ''
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
cd "${../.}" || exit 1
|
dir="${../.}"
|
||||||
|
|
||||||
|
# Apparently, dir is not always set to the Home Manager directory.
|
||||||
|
if [[ ! -d $dir ]]; then
|
||||||
|
echo ""
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
cd "$dir" || exit 1
|
||||||
|
|
||||||
# Get the base release and initialize an empty version suffix.
|
# Get the base release and initialize an empty version suffix.
|
||||||
release=$(< .release)
|
release=$(< .release)
|
||||||
|
|
Loading…
Reference in a new issue