Skip to content

Commit

Permalink
fix: fix _agenix_generation being empty if readlink fails
Browse files Browse the repository at this point in the history
  • Loading branch information
teatwig committed Sep 10, 2024
1 parent f6291c5 commit 4c3e972
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modules/age.nix
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ with lib; let
mount -t ramfs none "${cfg.secretsMountPoint}" -o nodev,nosuid,mode=0751
'';
newGeneration = ''
_agenix_generation="$(basename "$(readlink ${cfg.secretsDir})" || echo 0)"
_agenix_generation="$(basename "$(readlink "${cfg.secretsDir}" || echo 0)")"
(( ++_agenix_generation ))
echo "[agenix] creating new generation in ${cfg.secretsMountPoint}/$_agenix_generation"
mkdir -p "${cfg.secretsMountPoint}"
Expand Down

0 comments on commit 4c3e972

Please sign in to comment.