Skip to content

Commit 7082464

Browse files
committed
fix NewCommand
remove current and back directory references (. ,..) from templates list
1 parent f7b2073 commit 7082464

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/Commands/NewCommand.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
use DevNet\System\Command\CommandLine;
1515
use DevNet\System\Command\CommandOption;
1616
use DevNet\System\Command\ICommandHandler;
17-
use DevNet\System\Text\StringBuilder;
1817
use DevNet\System\IO\ConsoleColor;
1918
use DevNet\System\IO\Console;
2019

@@ -39,8 +38,6 @@ public function execute(object $sender, CommandEventArgs $args): void
3938
exit;
4039
}
4140

42-
$namespace = "Application";
43-
$className = "Program";
4441
$basePath = null;
4542
$template = $args->get('template');
4643
$help = $args->get('--help');
@@ -143,7 +140,12 @@ public function showHelp()
143140
$list = scandir($root . '/templates');
144141
}
145142

143+
// remove current and back directory references (. , ..)
144+
array_shift($list);
145+
array_shift($list);
146+
146147
$maxLenth = 0;
148+
$metadata = [];
147149
foreach ($list as $name) {
148150
if (file_exists($root . '/templates/' . $name . '/composer.json')) {
149151
$json = file_get_contents($root . '/templates/' . $name . '/composer.json');

0 commit comments

Comments
 (0)