mirror of
https://github.com/nix-community/home-manager.git
synced 2026-01-11 17:39:37 +08:00
home-environment: make getVersion more robust
(cherry picked from commit f67649307d)
This commit is contained in:
@@ -680,7 +680,15 @@ in
|
||||
getVersion = pkgs.writeShellScript "get-hm-version" ''
|
||||
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.
|
||||
release=$(< .release)
|
||||
|
||||
Reference in New Issue
Block a user