Skip to content

Commit

Permalink
feat(initcmd): sync mode
Browse files Browse the repository at this point in the history
  • Loading branch information
adhocore committed Aug 21, 2018
1 parent b79cf7c commit 4569a86
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Console/InitCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ protected function onConstruct()
->option('-N --namespace', 'Root namespace (use `/` separator)')
->option('-P --php', 'Minimum PHP version', 'floatval')
->option('-p --path', 'The project path (Auto resolved)')
->option('-S --sync', "Only create missing files\nUse with caution, take backup if needed", null, false)
->option('-f --force', 'Run even if the project exists', null, false)
->option('-g --package', 'Packagist name (Without vendor handle)')
->option('-d --descr', 'Project description')
Expand Down Expand Up @@ -134,7 +135,7 @@ protected function prepareProjectPath(): string
}

if (\is_dir($path)) {
if (!$this->force) {
if (!$this->force && !$this->sync) {
throw new InvalidArgumentException(
\sprintf('Something with the name "%s" already exists!', \basename($path))
);
Expand Down

0 comments on commit 4569a86

Please sign in to comment.