public function execute(InputInterface $input, OutputInterface $output) { $conf = $this->getGlobalConfig($input->getOption('config')); if (!Configuration::envsDir()) { throw new ConfigurationException("Path for environments configuration is not set.\n" . "Please specify envs path in your `codeception.yml`\n \n" . "envs: tests/_envs"); } $relativePath = $conf['paths']['envs']; $env = $input->getArgument('env'); $file = "{$env}.yml"; $path = $this->buildPath($relativePath, $file); $saved = $this->save($path . $file, "# `{$env}` environment config goes here"); if ($saved) { $output->writeln("<info>{$env} config was created in {$relativePath}/{$file}</info>"); } else { $output->writeln("<error>File {$relativePath}/{$file} already exists</error>"); } }