You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the scenario and circumstances that should be addressed
While it "feels" good that bpt repo remove doesn't report an error when the package to be removed doesn't exist anyways, it's also easy to mistype the package ID without being informed about it.
Describe the solution you'd like
Introduce a new --if-missing option to bpt repo remove, similar to bpt repo import --if-exists. Possible values might be ignore (same behavior as right now) and fail (which should issue an error if the package doesn't exist).
IMO the default behavior should be changed to fail as well because it's the safer default, but that I don't care about as much.
Additional context
I'm currently working on an HTTP API for a bpt repo and intend to report an error if the client attempts to delete a non-existent package (except if the client explicitly states that it doesn't care). The current workaround is checking that the package exists through bpt repo ls before attempting to remove it. This feels clunky, has to be manually guarded against races, and obviously doesn't help CLI usage of bpt.
The text was updated successfully, but these errors were encountered:
maxtruxa
changed the title
[FEATURE] bpt repo remove should have a --if-missing option
[FEATURE] Add bpt repo remove --if-missing={ignore,fail}Jun 9, 2022
Describe the scenario and circumstances that should be addressed
While it "feels" good that
bpt repo remove
doesn't report an error when the package to be removed doesn't exist anyways, it's also easy to mistype the package ID without being informed about it.Describe the solution you'd like
Introduce a new
--if-missing
option tobpt repo remove
, similar tobpt repo import --if-exists
. Possible values might beignore
(same behavior as right now) andfail
(which should issue an error if the package doesn't exist).IMO the default behavior should be changed to
fail
as well because it's the safer default, but that I don't care about as much.Additional context
I'm currently working on an HTTP API for a bpt repo and intend to report an error if the client attempts to delete a non-existent package (except if the client explicitly states that it doesn't care). The current workaround is checking that the package exists through
bpt repo ls
before attempting to remove it. This feels clunky, has to be manually guarded against races, and obviously doesn't help CLI usage of bpt.The text was updated successfully, but these errors were encountered: