Skip to content

Respect CORTEX_HOME for uninstall backups#393

Open
GreyforgeLabs wants to merge 1 commit into
CortexLM:mainfrom
GreyforgeLabs:uninstall-backup-cortex-home
Open

Respect CORTEX_HOME for uninstall backups#393
GreyforgeLabs wants to merge 1 commit into
CortexLM:mainfrom
GreyforgeLabs:uninstall-backup-cortex-home

Conversation

@GreyforgeLabs
Copy link
Copy Markdown

Summary

  • Use the resolved Cortex home directory for uninstall backup roots, so CORTEX_HOME places backups under that relocated state tree.
  • Collect uninstall candidates from the same resolved Cortex home instead of hardcoding $HOME/.cortex.
  • Avoid recursive self-copying when backups live under Cortex home, and keep dry-run backup previews non-destructive.
  • Add a CLI regression for uninstall --backup --dry-run with CORTEX_HOME set.

Fixes PlatformNetwork/bounty-challenge#52799.

Validation

  • cargo test -p cortex-cli --test uninstall_backup --no-default-features --features cortex-tui -- --nocapture
  • cargo check -p cortex-cli --no-default-features --features cortex-tui
  • cargo fmt --package cortex-cli --check
  • git diff --check

Copy link
Copy Markdown

@greptile-apps greptile-apps Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

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.

[BUG] [v0.0.7] cortex uninstall --backup writes to ~/.cortex-backup via dirs::home_dir(), ignoring CORTEX_HOME

1 participant