Skip to content

Commit

Permalink
Allow same-env snapshot install after dire warning
Browse files Browse the repository at this point in the history
  • Loading branch information
JacobSanford committed Nov 27, 2024
1 parent 7d6ad9a commit 90108da
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions src/Robo/Plugin/Commands/DaemonSnapshotCommands.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

}

/**
Expand Down

0 comments on commit 90108da

Please sign in to comment.