Skip to content

Commit

Permalink
home-environment: make getVersion more robust
Browse files Browse the repository at this point in the history
  • Loading branch information
rycee committed Oct 27, 2022
1 parent d3f2161 commit f676493
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion modules/home-environment.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit f676493

Please sign in to comment.