Skip to content

Commit b5d784f

Browse files
committed
fix: patch up create in '.' and command output
1 parent 5d648cb commit b5d784f

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/CreateCommand.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -124,19 +124,19 @@ protected function handle(): int
124124
$commands[] = 'cd ' . basename($directory);
125125
$commands[] = 'composer install --ansi';
126126
} else {
127-
$commands[] = 'composer create-project leafs/mvc:v4.x-dev ' . basename($directory) . ' --ansi';
127+
$commands[] = "composer create-project leafs/mvc:v4.x-dev '$directory' --ansi";
128128
$commands[] = 'cd ' . basename($directory);
129129
}
130130

131131
if ($this->option('no-ansi')) {
132132
$commands = array_map(function ($value) {
133-
return $value . ' --no-ansi';
133+
return "$value --no-ansi";
134134
}, $commands);
135135
}
136136

137137
if ($this->option('quiet')) {
138138
$commands = array_map(function ($value) {
139-
return $value . ' --quiet';
139+
return "$value --quiet";
140140
}, $commands);
141141
}
142142

@@ -202,7 +202,7 @@ protected function handle(): int
202202
],
203203
]);
204204

205-
$extraCommands = ['cd ' . basename($directory)];
205+
$extraCommands = ["cd '$directory'"];
206206

207207
if ($extraOptions['view'] ?? false) {
208208
$extraCommands[] = 'php leaf view:install ' . $extraOptions['view'];
@@ -224,7 +224,7 @@ protected function handle(): int
224224
]);
225225
}
226226

227-
if (sprout()->process(implode(' && ', $extraCommands))->setTimeout(null)->run() === 0) {
227+
if (sprout()->process(implode(' && ', $extraCommands))->setTimeout(null)->run() === 0 || count($extraCommands) === 1) {
228228
$this->writeln("\n🚀 Application scaffolded successfully");
229229
$this->writeln('👉 Get started with the following commands:');
230230
$this->writeln("\n <info>cd</info> " . basename($directory));

0 commit comments

Comments
 (0)