public function writeProfileToDotEnv($profile, $file = '.env')
{
$tmp = $this->getEnvVarsFromProfile($profile);
$res = file_put_contents($file, implode("\n", $tmp));
if ($res === false) {
throw new \Exception('Error while writing file .env');
}
return $file;
}