saveDotEnv method

bool saveDotEnv()

Save The DotEnv config to filePath.

This will overwrite the filePath if it exists.

Implementation

bool saveDotEnv() {
  final dotEnvFile = File(filePath);
  if (!dotEnvFile.existsSync()) {
    return false;
  }
  dotEnvFile.writeAsStringSync('');
  _env.forEach((String key, String value) {
    dotEnvFile.writeAsStringSync('$key=$value\n', mode: FileMode.append);
  });
  return true;
}