From fd4d901890847b0f86766d02d7a3b7302729cda2 Mon Sep 17 00:00:00 2001 From: Luke Tidd Date: Tue, 13 Dec 2022 11:38:32 -0500 Subject: [PATCH] fix subdir and hopefully gpg decrypt --- gclone | 6 +++--- gpull | 4 ++-- gpush | 8 ++++---- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/gclone b/gclone index 4880be7..7d7372c 100755 --- a/gclone +++ b/gclone @@ -1,5 +1,4 @@ #!/bin/bash - if [[ -z "$1" ]]; then printf 'Need a project:\n\n' >&2 pass show gitea/token >&2 @@ -12,7 +11,7 @@ shift token="$(pass show gitea/token/${project})" if [[ -z "$token" ]]; then printf 'Failed to get token for %s. ' "$project" >&2 - printf 'Must be one of:\n\n' "$project" >&2 + printf 'Must be one of:\n\n' >&2 pass show gitea/token >&2 exit 1 fi @@ -27,8 +26,9 @@ else readarray -t out <<< "$(git clone "$token_url" 2>&1)" new_dir="$(awk -F\' '{print $2}' <<< "$out")" cd "$new_dir" + git config user.signingkey "$gpg_key"! git config commit.gpgsign true git remote remove origin - git push --set-upstream "$url" main + GPG_TTY=$(tty) git push --set-upstream "$url" main fi diff --git a/gpull b/gpull index f6bc2de..7794fc6 100755 --- a/gpull +++ b/gpull @@ -9,7 +9,7 @@ fi token="$(pass show gitea/token/${project})" if [[ -z "$token" ]]; then printf 'Failed to get token for %s. ' "$project" >&2 - printf 'Must be one of:\n\n' "$project" >&2 + printf 'Must be one of:\n\n' >&2 pass show gitea/token >&2 exit 1 fi @@ -22,5 +22,5 @@ if [[ "$project" == 'pass' ]]; then else git config user.signingkey "$gpg_key"! git config commit.gpgsign true - git pull "$url" + GPG_TTY=$(tty) git pull "$url" fi diff --git a/gpush b/gpush index 02c99c0..8b2ae56 100755 --- a/gpush +++ b/gpush @@ -9,7 +9,7 @@ fi token="$(pass show gitea/token/${project})" if [[ -z "$token" ]]; then printf 'Failed to get token for %s. ' "$project" >&2 - printf 'Must be one of:\n\n' "$project" >&2 + printf 'Must be one of:\n\n' >&2 pass show gitea/token >&2 exit 1 fi @@ -21,14 +21,14 @@ if [[ "$project" == 'pass' ]]; then pass git push "$url" if [[ $? != 0 ]]; then printf 'no upstream. setting..\n' >&2 - git push --set-upstream "$url" main + GPG_TTY=$(tty) git push --set-upstream "$url" main fi else git config user.signingkey "$gpg_key"! git config commit.gpgsign true - git push "$url" + GPG_TTY=$(tty) git push "$url" if [[ $? != 0 ]]; then printf 'no upstream. setting..\n' >&2 - git push --set-upstream "$url" main + GPG_TTY=$(tty) git push --set-upstream "$url" main fi fi