Skip to content

Commit

Permalink
gh: only run migration when required
Browse files Browse the repository at this point in the history
  • Loading branch information
msfjarvis authored Jan 13, 2024
1 parent 7403ed4 commit 0912d26
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modules/programs/gh.nix
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ in {
home.activation.migrateGhAccounts =
let ghHosts = "${config.xdg.configHome}/gh/hosts.yml";
in hm.dag.entryBetween [ "linkGeneration" ] [ "writeBoundary" ] ''
if [[ ! -L "${ghHosts}" && -f "${ghHosts}" ]]; then
if [[ ! -L "${ghHosts}" && -f "${ghHosts}" && $(grep --invert-match --quiet '^version:' ${ghHosts}) ]]; then
(
TMP_DIR=$(mktemp -d)
trap "rm --force --recursive $TMP_DIR" EXIT
Expand Down

0 comments on commit 0912d26

Please sign in to comment.