Skip to content

[BUG] --force overwrites preserved files when rsync is unavailable #212

@c-vigo

Description

@c-vigo

Description

Running install.sh with --force should preserve user files listed in PRESERVE_FILES (including README.md and CHANGELOG.md).
When rsync is not available in the container, the fallback copy path overwrites those files anyway.

Steps to Reproduce

  1. Use an image/environment where rsync is not installed.
  2. In an existing workspace, customize README.md and CHANGELOG.md.
  3. Run:
    install.sh <workspace> --version dev --skip-pull --force --org vigOS
  4. Observe init output:
    Warning: rsync not available, preserved files may be overwritten
  5. Check README.md and CHANGELOG.md.

Expected Behavior

Files in the preserve list are never overwritten during --force, regardless of copy backend.

Actual Behavior

Preserved files are overwritten when fallback copy is used (no rsync).

Environment

  • OS: Linux
  • Container Runtime: Podman
  • Image Version/Tag: ghcr.io/vig-os/devcontainer:dev
  • Architecture: amd64

Additional Context

The init output lists preserved files correctly before copy, but fallback logic does not enforce preservation.

  • TDD compliance (see .cursor/rules/tdd.mdc)

Possible Solution

  • Add rsync to the image to use the primary safe copy path.
  • Keep fallback logic preserving files explicitly for robustness.
  • Add regression coverage for fallback behavior.

Changelog Category

Fixed

Metadata

Metadata

Assignees

Labels

area:workspaceWorkspace tooling, justfile, templatesbugSomething isn't workingeffort:smallLess than 1 hourpriority:highShould be done in the current milestonesemver:patchBug fix, backward-compatible

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions