From 5c07d913bbf43cddeba7938b90d54bac80e9a02d Mon Sep 17 00:00:00 2001 From: Tianshu Wang Date: Fri, 30 Aug 2024 17:49:22 +0800 Subject: [PATCH] Restore unison backup automatically --- config/unison/default.prf | 1 + darwin/setup.sh | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/config/unison/default.prf b/config/unison/default.prf index b412507..bb1c931 100644 --- a/config/unison/default.prf +++ b/config/unison/default.prf @@ -1,4 +1,5 @@ # Roots of the synchronization +## unison currently not support ~/$HOME in preference file root = /Users/wangtianshu root = /Users/wangtianshu/Library/Mobile Documents/com~apple~CloudDocs/Unison prefer = newer diff --git a/darwin/setup.sh b/darwin/setup.sh index adbcf84..4c2916c 100755 --- a/darwin/setup.sh +++ b/darwin/setup.sh @@ -72,5 +72,9 @@ done # Create Developer Directory mkdir -p ~/Developer +# Unison restore +UNISON_DIR="$HOME/Library/Mobile Documents/com~apple~CloudDocs/Unison" +[ -d $UNISON_DIR ] && UNISON=$XDG_CONFIG_HOME/unison unison -batch -force $UNISON_DIR + # Apply macoS system settings . "macOS.sh"