Update files-exp; Rename 3.files.yaml to 3.files-exp.yaml

This commit is contained in:
clsty
2025-11-01 09:52:34 +08:00
parent e3549e639e
commit 17984c812f
3 changed files with 152 additions and 147 deletions
+17 -7
View File
@@ -2,15 +2,25 @@
# It's not for directly running. # It's not for directly running.
# See https://github.com/end-4/dots-hyprland/issues/2137 # See https://github.com/end-4/dots-hyprland/issues/2137
#
# Stage 1 todos:
# TODO: add --exp-files-path <path> Use <path> 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 . # 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 .
# 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: add --exp-files-no-strict Ignore error when minor version number is not the same
#
# Stage 2 todos:
# TODO: Implement symlink (readable or non-readable) as sync mode # TODO: Implement symlink (readable or non-readable) as sync mode
# TODO: Implement --exp-file-reset-symlink to try to remove all symlink in .config and .local, which point to the local repo # TODO: add --exp-file-reset-symlink Try to remove all symlink in .config and .local, which point to the local repo
# TODO: Update help and doc about `--exp-files` and the yaml config, including the possible values of mode. # TODO: Update help and doc about `--exp-files` and the yaml config, including the possible values of mode.
#
# 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: Support exclude pattern for each target to skip some files inside it.
# Configuration file # Configuration file
CONFIG_FILE="sdata/subcmd-install/3.files.yaml" CONFIG_FILE="sdata/subcmd-install/3.files-exp.yaml"
# ============================================================================= # =============================================================================
wizard_update_preferences() { wizard_update_preferences() {
@@ -72,7 +82,7 @@ wizard_update_preferences() {
echo echo
echo "Preferences updated!" echo "Preferences updated!"
} }
# Get user preference # Get user preference
get_pref() { get_pref() {
@@ -95,7 +105,7 @@ should_process_pattern() {
[[ "$(get_pref "$type")" == "$value" ]] [[ "$(get_pref "$type")" == "$value" ]]
} }
# Compare hashes of files/directories, return true if they are the same, false otherwise # Compare hashes of files/directories, return true if they are the same, false otherwise
files_are_same() { files_are_same() {
@@ -123,7 +133,7 @@ files_are_same() {
# One is a file, one is a directory - different types # One is a file, one is a directory - different types
return 1 return 1
fi fi
} }
# Find next backup number # Find next backup number
get_next_backup_number() { get_next_backup_number() {
@@ -264,6 +274,6 @@ for pattern in "${patterns[@]}"; do
echo "Unknown mode: $mode" echo "Unknown mode: $mode"
;; ;;
esac esac
done done
##################################################################################### #####################################################################################
-5
View File
@@ -36,11 +36,6 @@ New features (experimental):
see https://github.com/end-4/dots-hyprland/issues/1061 for details. see https://github.com/end-4/dots-hyprland/issues/1061 for details.
${STY_RST}" ${STY_RST}"
} }
# TODO: implement options below for --exp-files
# --exp-files-path <path> Use <path> instead of the default yaml config
# --exp-files-no-strict Ignore error when minor version number is not the same
# --exp-files-regen Force copy the default config to ${EXP_FILE_PATH}
# (auto do this when not existed)
cleancache(){ cleancache(){
rm -rf "${REPO_ROOT}/cache" rm -rf "${REPO_ROOT}/cache"