diff options
author | Lassulus <github@lassul.us> | 2021-03-23 22:47:37 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-23 22:47:37 +0100 |
commit | cccebf3ff7a53336b3f106cb96dddd5892d427ed (patch) | |
tree | 459a07217d255b26763a3d9943903f99ae93445d /pkgs/populate/default.nix | |
parent | c2fa48550f2bb46009b9cecdb9ac838dc402ce19 (diff) | |
parent | 2ea0cdb99d3531849e8afdf0c668b55f1b4cc568 (diff) |
Merge pull request #30 from krebs/fixupsv1.25.0
(hopefully) fix pass with subfolders, make README more clear for extraOptions
Diffstat (limited to 'pkgs/populate/default.nix')
-rw-r--r-- | pkgs/populate/default.nix | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/pkgs/populate/default.nix b/pkgs/populate/default.nix index 476e653..517b12e 100644 --- a/pkgs/populate/default.nix +++ b/pkgs/populate/default.nix @@ -119,21 +119,25 @@ let rm -fR "$tmp_dir" } - ${findutils}/bin/find ${quote passPrefix} -type f -follow | + ${findutils}/bin/find ${quote passPrefix} -type f -follow ! -name .gpg-id | while read -r gpg_path; do rel_name=''${gpg_path#${quote passPrefix}} rel_name=''${rel_name%.gpg} pass_date=$( - ${git}/bin/git -C ${quote source.dir} log -1 --format=%aI "$gpg_path" + if test -e ${quote source.dir}/.git; then + ${git}/bin/git -C ${quote source.dir} log -1 --format=%aI "$gpg_path" + fi ) pass_name=${quote source.name}/$rel_name tmp_path=$tmp_dir/$rel_name ${coreutils}/bin/mkdir -p "$(${coreutils}/bin/dirname "$tmp_path")" PASSWORD_STORE_DIR=${quote source.dir} ${pass}/bin/pass show "$pass_name" > "$tmp_path" - ${coreutils}/bin/touch -d "$pass_date" "$tmp_path" + if [ -n "$pass_date" ]; then + ${coreutils}/bin/touch -d "$pass_date" "$tmp_path" + fi done if test -n "''${local_pass_info-}"; then |