Skip to content

Repair settings paths left behind by a moved tool folder - #3

Merged
razbenaharon merged 1 commit into
mainfrom
fix-moved-folder-settings-path
Nov 9, 2026
Merged

razbenaharon merged 1 commit into
mainfrom
fix-moved-folder-settings-path

Conversation

@razbenaharon

Copy link
Copy Markdown
Owner

Problem

Each source stores its settings file by full path in profiles.local.json. After the tool folder was renamed from BackupCenter to DevDriveBackup, that path went stale and the app showed:

Cannot find path 'E:\Projects\BackupCenter\backup.local.json' because it does not exist.

Fix

Read-CenterProfiles now repairs a missing settings path when profiles load. It looks for a file of the same name in the jobs folder or beside the profiles file and accepts it only when:

  • it is a regular file that parses as JSON, and
  • its Source and MirrorFolder match this source.

Unreadable or incomplete candidates are skipped, so loading never fails because of a candidate. The repaired path is saved.

Tests

  • Test-DevDriveBackup.ps1 -DestinationDrive G: new checks that a stale path is repaired and saved, and that a same-name file describing another source is not taken. Passed.
  • Checked by hand that an empty {} candidate no longer breaks loading.
  • Test-BackupStatus, Test-BackupTheme and Test-PrivacyGuard passed. The app starts without an error dialog.

🤖 Generated with Claude Code

Each source stores its settings file by full path, so renaming the tool
folder (BackupCenter -> DevDriveBackup) left a stale path and the app
failed with "Cannot find path". When loading profiles, a missing settings
path is now repointed to a file of the same name in the jobs folder or
beside the profiles file, but only when that file describes the same
source folder and plain copy folder. Unreadable or incomplete candidates
are skipped. Tests cover the repair and the refusal of another source's file.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@razbenaharon
razbenaharon merged commit c0322d5 into main Nov 9, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant