Skip to content

Commit

Permalink
Sanitize command names for make:command
Browse files Browse the repository at this point in the history
  • Loading branch information
bastianallgeier committed Oct 5, 2022
1 parent c8341cd commit c2729d2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions commands/make/command.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
],
'command' => static function (CLI $cli): void {
$name = $cli->argOrPrompt('name', 'Enter a name for the command:');
$name = str_replace(':', '/', $name);

$root = $cli->arg('global') === true ? 'commands.global' : 'commands.local';
$file = $cli->root($root) . '/' . $name . '.php';

Expand Down

0 comments on commit c2729d2

Please sign in to comment.