From efae444942db1284411d857277d0b931778deb35 Mon Sep 17 00:00:00 2001 From: clsty Date: Sat, 1 Nov 2025 10:16:45 +0800 Subject: [PATCH] Update files-exp --- sdata/subcmd-install/3.files-exp.sh | 4 ++-- sdata/subcmd-install/3.files-exp.yaml | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/sdata/subcmd-install/3.files-exp.sh b/sdata/subcmd-install/3.files-exp.sh index b3833251c..0bccb092e 100644 --- a/sdata/subcmd-install/3.files-exp.sh +++ b/sdata/subcmd-install/3.files-exp.sh @@ -4,6 +4,7 @@ # See https://github.com/end-4/dots-hyprland/issues/2137 # # Stage 1 todos: +# TODO: Properly handle hyprland config, ~/.config/hypr/hyprland.conf should be overwritten only when firstrun # TODO: add --exp-files-path Use instead of the default yaml config # TODO: add --exp-files-regen Force copy the default config to ${EXP_FILE_PATH} (auto do this when not existed) # TODO: Implement versioning, i.e. when user-defined yaml config file has version number mismatch with the default one, produce error. If only minor version number is not the same, the error can be ommitted via --exp-file-no-strict . @@ -16,8 +17,7 @@ # # Stage 3 todos: # TODO: Implement user-define yaml with merging (override) ability for user who only wants little customization and is satisfied with most of the defaults. -# TODO: Support exclude pattern for each target to skip some files inside it. - +# TODO: Implement variants like keybindings, terminals, etc under user_preferences. # Configuration file CONFIG_FILE="sdata/subcmd-install/3.files-exp.yaml" diff --git a/sdata/subcmd-install/3.files-exp.yaml b/sdata/subcmd-install/3.files-exp.yaml index 59ed69ebc..5282e0594 100644 --- a/sdata/subcmd-install/3.files-exp.yaml +++ b/sdata/subcmd-install/3.files-exp.yaml @@ -1,3 +1,11 @@ +# The possible values of `mode`: (by default `sync`) +# - `sync`: Make the destination completely the same as the source. +# - `soft`: Skip existing files when copying +# - `hard`: Overwrite existing files when copying +# - `soft-backup`: If target file exists, copy source file to `*.new`. Do not create `*.new` but skip coyping when source and target HASH values are exactly the same. +# - `hard-backup`: If target file exists, create backup by renaming it to `*.old.` where `` is a number increment from 1 to prevent backup gets overwritten when running twice. (Keep in mind that this script must be idempotent.) Also must compare the actual file content by using MD5 HASH value to prevent generating lots of `*.old.`s when runnng multiple times. Do not create backup but skip coyping when source and target HASH values are exactly the same. +# - `skip`: Skip this step +# - `skip-if-exists`: Skip this step if target exists version: "1.0" user_preferences: shell: "fish" # fish | zsh