Prompt developer to confirm installing over existing install
This commit is contained in:
parent
75f7459c40
commit
7d56c6f37e
1 changed files with 9 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue