1
0
Fork 0
mirror of synced 2024-10-01 01:37:56 +13:00

Prompt developer to confirm installing over existing install

This commit is contained in:
Steven Nguyen 2023-07-25 13:50:43 -07:00
parent 75f7459c40
commit 7d56c6f37e
No known key found for this signature in database

View file

@ -67,6 +67,15 @@ class Install extends Action
$data = @file_get_contents($this->path . '/docker-compose.yml');
if ($data !== false) {
if ($interactive == 'Y' && Console::isInteractive()) {
$answer = Console::confirm('Previous installation found, do you want to overwrite it? (Y/n)');
if ($answer !== 'Y') {
Console::info('No action taken.');
return;
}
}
$time = \time();
Console::info('Compose file found, creating backup: docker-compose.yml.' . $time . '.backup');
file_put_contents($this->path . '/docker-compose.yml.' . $time . '.backup', $data);