fix subdir and hopefully gpg decrypt

This commit is contained in:
2022-12-13 11:38:32 -05:00
parent 7eec287f83
commit fd4d901890
3 changed files with 9 additions and 9 deletions

8
gpush
View File

@@ -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