diff --git a/src/Command/NewCommand.php b/src/Command/NewCommand.php index 5b09772..6a10ea7 100644 --- a/src/Command/NewCommand.php +++ b/src/Command/NewCommand.php @@ -192,10 +192,14 @@ public function __invoke(): int $webRoot = $defaultWebRoot; } $envUpdated = false; - if ($envExampleExists && !$envExists) { + if (!$envExists) { $this->section('Environment Setup'); - (new Process(['cp', '.env.example', '.env'], $directory))->run(); + if ($envExampleExists) { + copy($directory . DIRECTORY_SEPARATOR . '.env.example', $directory . DIRECTORY_SEPARATOR . '.env'); + } else { + copy($directory . DIRECTORY_SEPARATOR . 'core' . DIRECTORY_SEPARATOR . 'module_system' . DIRECTORY_SEPARATOR . '.env.example.root', $directory . DIRECTORY_SEPARATOR . '.env'); + } $dbName = null; if ($this->input->isInteractive()) {