From 90108daaf36cdfb72996e7858fc54ce104ef7b2e Mon Sep 17 00:00:00 2001 From: Jacob Sanford Date: Wed, 27 Nov 2024 09:55:10 -0400 Subject: [PATCH] Allow same-env snapshot install after dire warning --- .../Commands/DaemonSnapshotCommands.php | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/src/Robo/Plugin/Commands/DaemonSnapshotCommands.php b/src/Robo/Plugin/Commands/DaemonSnapshotCommands.php index 5c4ed0a..181c4f5 100644 --- a/src/Robo/Plugin/Commands/DaemonSnapshotCommands.php +++ b/src/Robo/Plugin/Commands/DaemonSnapshotCommands.php @@ -265,19 +265,18 @@ protected function validateCommandOptions(array $options): void $options['target-env'] ) ); - exit(0); - } - - if ($options['target-env'] === $options['source-env']) { $this->dockworkerIO->warning( - sprintf( - 'The source [%s] and destination environments [%s] are the same.', - $options['source-env'], - $options['target-env'] - ) + 'This is likely not what you want to do! You will roll back the data to the snapshot time.' ); - exit(0); + if ( + !$this->dockworkerIO->confirm( + 'Are you sure you want to continue anyway?' + ) + ) { + exit(0); + } } + } /**