mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-19 23:11:44 +01:00
dvc: add confirmation for dvc destroy
Signed-off-by: Ruslan Kuprieiev <[email protected]>
This commit is contained in:
committed by
Ruslan Kuprieiev
parent
586fde5f95
commit
fef8ea4602
+12
-1
@@ -1,9 +1,20 @@
|
||||
from dvc.command.common.base import CmdBase
|
||||
from dvc.prompt import prompt
|
||||
|
||||
|
||||
class CmdDestroy(CmdBase):
|
||||
def run(self):
|
||||
def run_cmd(self):
|
||||
try:
|
||||
msg = u'This will destroy all information about your pipelines as ' \
|
||||
u'well as cache in .dvc/cache.\n' \
|
||||
u'Are you sure you want to continue?'
|
||||
|
||||
if not self.args.force and not prompt(msg, False):
|
||||
err = u'Cannot destroy without a confirmation from the user. ' \
|
||||
u'Use \'-f\' to force.'
|
||||
self.project.logger.error(err)
|
||||
return 1
|
||||
|
||||
self.project.destroy()
|
||||
except Exception as exc:
|
||||
self.project.logger.error('Failed to destroy DVC', exc)
|
||||
|
||||
Reference in New Issue
Block a user