Skip to content

Commit

Permalink
vault.decrypt will also strip .enc suffix when in VAULT_FILES, god fo…
Browse files Browse the repository at this point in the history
…r ssh keys, etc that dont normally have a suffix.
  • Loading branch information
basejump committed Sep 2, 2023
1 parent 9d39c79 commit b8ec373
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions makefiles/vault.make
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,9 @@ vault.decrypt: $(VAULT_DIR)
$(VAULT_DIR): | $(SOP_SH) vault.gpg.import-private-key vault.clone
cd $(VAULT_DIR)
for vfile in $(VAULT_FILES); do
outFile="$${vfile/.enc./.}" # remove .enc.
outFile="$${outFile/.encrypted./.}" # remove .encrypted.
outFile="$${vfile/.enc./.}" # remove .enc. in middle, if its "foo.enc.txt" remove middle enc, leaving "foo.txt"
outFile="$${vfile/.enc/}" # if its foo.enc this removes the .enc suffix and just leaves "foo"
outFile="$${outFile/.encrypted./.}" # remove .encrypted. same a .enc. above.
$(logr) "$$vfile > $$outFile"
$(SOP_SH) -d $$vfile > $$outFile
done
Expand Down

0 comments on commit b8ec373

Please sign in to comment.