Skip to content

Commit

Permalink
Disable interactive mode for first run only when script finishes prop…
Browse files Browse the repository at this point in the history
…erly #20
  • Loading branch information
NicoHood committed Jan 25, 2021
1 parent 7c8bacc commit 1bf31ca
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions gpgit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ EOF

function interactive()
{
if [[ "${INTERACTIVE}" == "true" ]]; then
if [[ "${INTERACTIVE}" == "true" || -z "${INTERACTIVE}" ]]; then
[[ "${#}" -gt 0 ]] && echo "${*}" >&2
read -rp "Continue? [Y/n]" yesno
if [[ "${yesno}" != [Yy]"es" && "${yesno}" != [Yy] && -n "${yesno}" ]]; then
Expand Down Expand Up @@ -315,9 +315,7 @@ echo "${BOLD}GPGit ${VERSION} https://github.com/NicoHood/gpgit${ALL_OFF}" >&2
echo "" >&2

if [[ -z "${INTERACTIVE}" ]]; then
INTERACTIVE=true
interactive "Running GPGit for the first time. This will guide you through all steps of secure source code signing once. If you wish to run interactively again pass the -i option to GPGit. For more options see --help."
git config --global gpgit.interactive "false"
fi

# When using a Github remote ask for github token first,
Expand Down Expand Up @@ -673,4 +671,8 @@ else
done
fi

if [[ -z "${INTERACTIVE}" ]]; then
git config --global gpgit.interactive "false"
fi

msg "Finished without errors."

0 comments on commit 1bf31ca

Please sign in to comment.