Clean up
This commit is contained in:
@@ -133,12 +133,16 @@ public class DotenvCommand : Command, ISubCommandOf<RootCommand>
|
||||
private async Task ExecuteAsync(string vars, bool overwrite)
|
||||
{
|
||||
var path = Path.Join(Environment.CurrentDirectory, ".env");
|
||||
var exists = File.Exists(path);
|
||||
|
||||
if (exists && !overwrite)
|
||||
if (File.Exists(path))
|
||||
{
|
||||
if (overwrite)
|
||||
{
|
||||
await _context.WriteFile(".env", content);
|
||||
return;
|
||||
}
|
||||
|
||||
Console.WriteLine($"File {path} already exists, add the -o or --overwrite flag to overwrite it.");
|
||||
return;
|
||||
}
|
||||
|
||||
var content = string.Join(Environment.NewLine, vars.Split(';'));
|
||||
|
||||
Reference in New Issue
Block a user