Skip to content

Add update-profile backup and removal support #1366

Description

@codeforester

Problem

basectl update-profile mutates shell startup files by writing Base-managed sections, but the command does not surface an automatic backup of pre-edit files or a --remove path to remove Base-managed sections. Shell startup mutation is a high-trust part of adoption.

Evidence

  • update-profile --help lists --defaults, --no-defaults, and --dry-run, but no removal option.
  • The update path writes managed sections into ~/.bash_profile, ~/.bashrc, ~/.zprofile, and ~/.zshrc.

Desired outcome

Give users a reversible profile update path that preserves pre-edit files before mutation and can remove Base-managed sections without hand-editing dotfiles.

Scope

  • Add automatic backup behavior for files that will be changed.
  • Add an explicit remove path for Base-managed profile sections.
  • Keep dry-run behavior accurate.
  • Do not remove user-authored content outside Base-managed markers.

Acceptance criteria

  • basectl update-profile creates timestamped backups before changing existing dotfiles.
  • basectl update-profile --remove removes only Base-managed sections.
  • --dry-run reports planned backups/removals without writing.
  • BATS cover update, remove, backup, and dry-run behavior.
  • README or command reference documents the reversible path.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or product improvement

Type

No type

Fields

No fields configured for issues without a type.

Projects

Status
Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions