diff options
| author | Mitchell Riedstra <mitch@riedstra.dev> | 2025-12-13 10:24:04 -0500 |
|---|---|---|
| committer | Mitchell Riedstra <mitch@riedstra.dev> | 2025-12-13 10:24:04 -0500 |
| commit | 014c2ee5eb6b4ba8b16b2e81ac71b13ecf401081 (patch) | |
| tree | f82c68cfbda776f3f0ba17d1706d1a842b8cd668 | |
| parent | 51a82abad5cd1c98cbfe94cf36fcca7bb30acf01 (diff) | |
| download | dpw-014c2ee5eb6b4ba8b16b2e81ac71b13ecf401081.tar.gz dpw-014c2ee5eb6b4ba8b16b2e81ac71b13ecf401081.tar.xz | |
Add a sync command to dpw-age.
| -rwxr-xr-x | dpw-age | 17 |
1 files changed, 16 insertions, 1 deletions
@@ -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 |
