aboutsummaryrefslogtreecommitdiff
path: root/dpw-age
diff options
context:
space:
mode:
Diffstat (limited to 'dpw-age')
-rwxr-xr-xdpw-age17
1 files changed, 16 insertions, 1 deletions
diff --git a/dpw-age b/dpw-age
index 87f5dd9..079e2ee 100755
--- a/dpw-age
+++ b/dpw-age
@@ -80,6 +80,20 @@ exit 1
# Interface
+sync() {
+ if [ $USE_GIT -eq 0 ] ; then
+ echo "Cannot sync, not a git repository"
+ return
+ fi
+ if [ "$DPW_AGE_AUTO_SYNC" != "YES" ] ; then
+ echo "Warning: DPW_AGE_AUTO_SYNC is not set to YES"
+ echo "Syncing..."
+ DPW_AGE_AUTO_SYNC=YES
+ fi
+
+ _git_sync
+}
+
show() {
pth="$1"; shift
#shellcheck disable=SC2086
@@ -243,7 +257,7 @@ Where command may be one of:
list
insert
rm
- reencrypt
+ sync
init
The 'init' command has its own help page.
@@ -271,6 +285,7 @@ case $act in
list) list "$@" ;;
insert) insert "$@" ;;
rm) remove "$@" ;;
+ sync) sync ;;
init) _init "$@" ;;
*) _help; echo "Bad command $act"; exit 1; ;;
esac