Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tcb-bundle task should delete the bundle folder on starting? #266

Open
escherstair opened this issue Sep 24, 2024 · 4 comments
Open

tcb-bundle task should delete the bundle folder on starting? #266

escherstair opened this issue Sep 24, 2024 · 4 comments

Comments

@escherstair
Copy link
Contributor

escherstair commented Sep 24, 2024

I see that tcb template has a tcb-bundle task
https://github.com/toradex/vscode-torizon-templates/blob/df4eeecf92aed9fb3cff59252f6b25735f7a6321/tcb/.vscode/tasks.json#L342-L378

It downloads the container images in a local directory, as described here

As far as I understand, if the local bundle folder already exists, it's not deleted and ovewritten downloading new containers, but it's used as it is.
If this is the case, it could contain old taghs of containers (from previous bundle commands).

Shouldn't tcb-bundle task start with the deletion of the bundle local folder (if it exists)?

@escherstair
Copy link
Contributor Author

This message on Toradex community explains that this behavior is possible using bundle --force which forces torizoncore-builder to delete any pre-existing bundle directory before creating a new one.

Should this be the default behavior?

@leograba
Copy link
Member

leograba commented Nov 7, 2024

It seems sensible to be, because in the context of the IDE it makes usage more ergonomic.

The build command should make it easy to re-create the directory if deleted by mistake. Allied to Git, it should be trivial to revert unintended changes.

@lucas-akira, as a TCB developer, do you have any thoughts?

@microhobby @andreriesco what about on the IDE side? Thoughts or concerns?

@lucas-akira
Copy link
Contributor

When using TCB as a separate command line interface, its default behavior is to avoid overwriting existing files and directories unless explicitly instructed by the user via the --force flag. We do this to reduce the risk of accidental data loss. Plus, it is also possible to specify a different directory for the bundle output with the --bundle-directory argument.

If the TCB template on the IDE extension only uses one default bundle directory and it's not possible to change that, I guess it makes sense to overwrite it by default when running the bundle task.

@microhobby
Copy link
Collaborator

or also add an second task, that will run the with --force, with a user input like "have you sure? this will delete the bundle folder" or some like this.

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

No branches or pull requests

4 participants