Skip to content

Commit

Permalink
Show message when successfully synchronized with remote
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonVanAssche committed Nov 26, 2022
1 parent 46a88bb commit b802114
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions bashpass
Original file line number Diff line number Diff line change
Expand Up @@ -329,10 +329,20 @@ Sync() {
[Uu]pload)
git --git-dir="${passLocation}/.git/" --work-tree="${passLocation}" add .
git --git-dir="${passLocation}/.git/" --work-tree="${passLocation}" commit -m "Synchronize passwords ($(printf '%(%d/%m/%Y)T at %(%T)T)')"
git --git-dir="${passLocation}/.git/" --work-tree="${passLocation}" push
if git --git-dir="${passLocation}/.git/" --work-tree="${passLocation}" push; then
printf '\n'
printf 'Remote password(s) successfully synchronized with local.'
else
Kill "failed to upload password(s) to ${gitRepo}" "1"
fi
;;
[Dd]ownload)
git --git-dir="${passLocation}/.git/" --work-tree="${passLocation}" pull
if git --git-dir="${passLocation}/.git/" --work-tree="${passLocation}" pull; then
printf '\n'
printf 'Local password(s) successfully synchronized with remote.'
else
Kill "failed to download password(s) to ${gitRepo}" "1"
fi
;;
*)
Kill "unknown option '${1}'" "22"
Expand Down

0 comments on commit b802114

Please sign in to comment.