diff options
| author | Federico Angelilli <code@fedang.net> | 2024-01-02 19:11:14 +0100 |
|---|---|---|
| committer | Federico Angelilli <code@fedang.net> | 2024-01-02 19:11:14 +0100 |
| commit | 92019cdd04312a1246e28d12a9f8445e0bc3a7a0 (patch) | |
| tree | 51b60d52ba0b0820cf84d87893ae2ceb10253a89 | |
| parent | e4d74a176393fcfb125ca7d1a48945572c8b6b24 (diff) | |
Change entries template creation
| -rwxr-xr-x | crypt.sh | 17 |
1 files changed, 8 insertions, 9 deletions
@@ -126,13 +126,6 @@ git_init() { echo "$CRYPT_ARCHIVE.*" > "$CRYPT_PATH/.gitignore" git_track '.gitignore' "Configure gitignore." - local file="$CRYPT_PATH/.entries" - [[ ! -f "$file" ]] && \ - echo 'extension=txt name=text edit_action="$EDITOR" insert_action="$EDITOR" show_action="cat" color = cyan' > "$file" && \ - echo 'extension=pass name=password edit_action="$EDITOR" insert_action="$EDITOR" show_action="cat" color=red' >> "$file" - - git_track '.entries' "Add entries template." - git -C "$INNER_GIT_DIR" config --local diff.gpg.binary true git -C "$INNER_GIT_DIR" config --local diff.gpg.textconv "$GPG -d ${GPG_OPTS[*]}" } @@ -428,11 +421,17 @@ cmd_init() { printf "%s\n" "$@" > "$gpg_id" local id_print="$(printf "%s, " "$@")" echo "Crypt initialized for ${id_print%, }" + git_track "$gpg_id" "Set GPG id to ${id_print%, }." + gpg_sign "$gpg_id" && git_track "$gpg_id.sig" "Signing new GPG id with $CRYPT_SIGNING_KEY." - gpg_sign "$gpg_id" && git_track "$gpg_id.sig" "Signing new GPG id with ${key//[$IFS]/,}." local entries="$CRYPT_PATH/.entries" - gpg_sign "$entries" && git_track "$entries.sig" "Signing .entries with ${key//[$IFS]/,}." + [[ ! -f "$entries" ]] && \ + echo 'extension=txt name=text edit_action="$EDITOR" insert_action="$EDITOR" show_action="cat" color = cyan' > "$entries" && \ + echo 'extension=pass name=password edit_action="$EDITOR" insert_action="$EDITOR" show_action="cat" color=red' >> "$entries" + + git_track "$entries" "Add entries template." + gpg_sign "$entries" && git_track "$entries.sig" "Signing entries template with $CRYPT_SIGNING_KEY." fi reencrypt_path "$CRYPT_PATH/" |
