diff options
| author | Don Williams <don.e.williams@gmail.com> | 2026-08-25 16:06:01 -0400 |
|---|---|---|
| committer | Pinapelz <yukais@pinapelz.com> | 2026-08-29 21:41:35 -0700 |
| commit | 019cc83cee148b3a9f327f079f0247ee7425b863 (patch) | |
| tree | 71a3a93e45c7ac530877c6c612d19c8654960c01 /scripts | |
| parent | 7b1a3764615a9c7bd6e83475a8a0111ad1eca623 (diff) | |
copy.sh didn't update LUA system files
Signed-off-by: Don Williams <don.e.williams@gmail.com>
On branch development
Your branch is up to date with 'origin/development'.
Changes to be committed:
modified: CHANGELOG.md
modified: scripts/lib_copy.sh
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/lib_copy.sh | 39 |
1 files changed, 19 insertions, 20 deletions
diff --git a/scripts/lib_copy.sh b/scripts/lib_copy.sh index 184381a8..da78ca16 100644 --- a/scripts/lib_copy.sh +++ b/scripts/lib_copy.sh @@ -227,22 +227,34 @@ ensure_lua_keybinds() { rel_path="${src_file#$src_root/}" dst_file="$dst_root/$rel_path" - if [ ! -f "$dst_file" ]; then + # UserConfigs are protected: only add missing templates + if [ "$rel_dir" = "UserConfigs" ]; then + if [ ! -f "$dst_file" ]; then + mkdir -p "$(dirname "$dst_file")" + if cp -f "$src_file" "$dst_file" 2>&1 | tee -a "$log"; then + copied=1 + echo "${NOTE:-[NOTE]} - Added missing user config template: ${YELLOW:-}$rel_path${RESET:-}" 2>&1 | tee -a "$log" + else + echo "${ERROR:-[ERROR]} - Failed to add missing user config template: ${YELLOW:-}$rel_path${RESET:-}" 2>&1 | tee -a "$log" + fi + fi + else + # System directories (configs, lua): always sync/overwrite from repo mkdir -p "$(dirname "$dst_file")" if cp -f "$src_file" "$dst_file" 2>&1 | tee -a "$log"; then copied=1 - echo "${NOTE:-[NOTE]} - Added missing Lua file: ${YELLOW:-}$rel_path${RESET:-}" 2>&1 | tee -a "$log" + echo "${NOTE:-[NOTE]} - Synced system file: ${YELLOW:-}$rel_path${RESET:-}" 2>&1 | tee -a "$log" else - echo "${ERROR:-[ERROR]} - Failed to add missing Lua file: ${YELLOW:-}$rel_path${RESET:-}" 2>&1 | tee -a "$log" + echo "${ERROR:-[ERROR]} - Failed to sync system file: ${YELLOW:-}$rel_path${RESET:-}" 2>&1 | tee -a "$log" fi fi done < <(find "$src_dir" -maxdepth 1 -type f -name '*.lua' -print0) done if [ "$copied" -eq 1 ]; then - echo "${OK:-[OK]} - Lua fallback copy completed." 2>&1 | tee -a "$log" + echo "${OK:-[OK]} - Lua files sync completed." 2>&1 | tee -a "$log" else - echo "${INFO:-[INFO]} - Lua fallback check: no missing Lua files detected." 2>&1 | tee -a "$log" + echo "${INFO:-[INFO]} - Lua files check: up to date." 2>&1 | tee -a "$log" fi } @@ -306,7 +318,8 @@ restore_hypr_assets() { # Fresh installs should apply repo defaults; do not restore a previous wallpaper. # RUN_MODE is set by copy.sh (install|upgrade|express) and is visible here. - local DIR_B=("Monitor_Profiles" "animations") + # Note: animations is a system directory and remains managed by dotfiles (not restored from backup). + local DIR_B=("Monitor_Profiles") if [ "${RUN_MODE:-}" != "install" ]; then DIR_B+=("wallpaper_effects") else @@ -533,7 +546,6 @@ restore_user_configs() { local BACKUP_DIR BACKUP_DIR=$(get_backup_dirname) local BACKUP_DIR_PATH="$DIRPATH-backup-$BACKUP_DIR/UserConfigs" - local BACKUP_CONFIGS_PATH="$DIRPATH-backup-$BACKUP_DIR/configs" if [ -z "$BACKUP_DIR" ]; then echo "${ERROR:-[ERROR]} - Backup directory name is empty. Exiting." 2>&1 | tee -a "$log" @@ -644,19 +656,6 @@ restore_user_configs() { fi fi - if [ -d "$BACKUP_CONFIGS_PATH" ]; then - local restored_system_lua=0 - local lua_file - mkdir -p "$DIRPATH/configs" - while IFS= read -r -d '' lua_file; do - cp -f "$lua_file" "$DIRPATH/configs/" - restored_system_lua=1 - done < <(find "$BACKUP_CONFIGS_PATH" -maxdepth 1 -type f -name 'system_*.lua' -print0) - if [ "$restored_system_lua" -eq 1 ]; then - echo "${OK:-[OK]} - Restored migrated system Lua overlays to $DIRPATH/configs." 2>&1 | tee -a "$log" - fi - fi - # Always run de-dupe based on the installed dotfiles version so that # express mode and standard mode behave consistently. Prefer the # pre-upgrade version (old_version) if provided so we still clean up |
