PlanktoScope / forklift

Composable, reprovisionable, decentralized management of apps & configs on Raspberry Pis and other embedded Linux systems
Apache License 2.0
6 stars 0 forks source link

ui: `plt switch/rm` should only delete unsaved changes on a local pallet with user confirmation #229

Closed ethanjli closed 3 weeks ago

ethanjli commented 1 month ago

Currently, the plt switch and plt rm subcommands delete the previous local pallet without checking whether it has any changes which have not been uploaded to a remote Git repo. It would be better to only enable that behavior with a --force flag, and the default behavior should be changed so that plt switch/rm (without a --force flag) will only delete the previous local pallet when all of the following conditions are met:

  1. the existing local pallet is a Git repo
  2. all changes in the existing local pallet have been pushed to a remote Git repo

If either of those conditions are not met, it would be very nice if the plt switch/rm subcommand would provide a simple TUI (using https://github.com/charmbracelet/huh) to help the user back up their changes to GitHub before plt switch deletes the local pallet; we'd need a command-line flag (maybe a global --frontend=noninteractive) to disable interactivity, for use in scripts.