aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMitchell Riedstra <mitch@riedstra.dev>2025-12-13 10:24:04 -0500
committerMitchell Riedstra <mitch@riedstra.dev>2025-12-13 10:24:04 -0500
commit014c2ee5eb6b4ba8b16b2e81ac71b13ecf401081 (patch)
treef82c68cfbda776f3f0ba17d1706d1a842b8cd668
parent51a82abad5cd1c98cbfe94cf36fcca7bb30acf01 (diff)
downloaddpw-014c2ee5eb6b4ba8b16b2e81ac71b13ecf401081.tar.gz
dpw-014c2ee5eb6b4ba8b16b2e81ac71b13ecf401081.tar.xz
Add a sync command 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