From 014c2ee5eb6b4ba8b16b2e81ac71b13ecf401081 Mon Sep 17 00:00:00 2001 From: Mitchell Riedstra Date: Sat, 13 Dec 2025 10:24:04 -0500 Subject: Add a sync command to dpw-age. --- dpw-age | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'dpw-age') 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 -- cgit v1.2.3