creating backup of existing file
This commit is contained in:
parent
a2466956ec
commit
fd2edd9164
1 changed files with 4 additions and 0 deletions
|
@ -65,6 +65,8 @@ $cli
|
|||
$data = @file_get_contents($path.'/docker-compose.yml');
|
||||
|
||||
if($data !== false) {
|
||||
Console::info("found old docker-compose.yml file, creating backup docker-compose.yml.backup");
|
||||
file_put_contents($path.'/docker-compose.yml.bak',$data);
|
||||
$compose = new Compose($data);
|
||||
$appwrite = $compose->getService('appwrite');
|
||||
$oldVersion = ($appwrite) ? $appwrite->getImageVersion() : null;
|
||||
|
@ -90,6 +92,8 @@ $cli
|
|||
$data = @file_get_contents($path.'/.env');
|
||||
|
||||
if($data !== false) { // Fetch all env vars from previous .env file
|
||||
Console::info("found old .env file, creating .env.backup");
|
||||
file_put_contents($path.'/.env.bak',$data);
|
||||
$env = new Env($data);
|
||||
|
||||
foreach ($env->list() as $key => $value) {
|
||||
|
|
Loading…
Reference in a new issue