1
0
Fork 0
mirror of synced 2024-09-29 08:51:28 +13:00

creating backup of existing file

This commit is contained in:
Damodar Lohani 2021-05-18 13:43:01 +05:45
parent a2466956ec
commit fd2edd9164

View file

@ -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) {