Closed reaganlo closed 4 years ago
@reaganlo should we overwrite the file if it already exists? as bundle create is alias to bundle edit as well. And current default for upstream is to overwrite the destination file if it exists.
I intentionally wanted to change the current behavior even for default case (mixer bundle create/edit bundlename
). If bundle name already exists in local-bundles, then do not overwrite. Instead inform the user with a messageBundle "os-core" already exists in local-bundles; skipping
as per offline discussion, it makes sense to inform user that bundle definition file already exist and skip checking further
This change wont affect anything for devops. if local file exists, we just skip checking upstream. if local doesn't exists, we check if bundle exists upstream . If it does, download and overwrite with latest and copy to local dir. This is the current flow and this flow will remain the same.
Sounds good. Thanks for following up.
@ashleshaAtrey Let the message indicate the full path of the local-bundles dir..
Bundle "os-core" already exists in <local-bundles>; skipping
Currently, during bundle create, Mixer copies the bundle definition from upstream if it exists. This can remain as the default behavior. But users should be able to explicitly create a new local bundle even if the name exists upstream. This can be done by introducing a directory with only the header information. If the file already exists in the directory, do not overwrite it. Inform the user with a message
--local
flag formixer bundle create
. E.g.mixer bundle create os-core --local
This should create an emptyos-core
definition file in the \Bundle "os-core" already exists in local-bundles; skipping