Skip to content

Commit

Permalink
Merge pull request #119 from MetalArend/multi-path
Browse files Browse the repository at this point in the history
Load and unload multiple paths in one call
  • Loading branch information
apfelbox committed Oct 5, 2022
2 parents 0673ec8 + fb3d368 commit 1dafb62
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
14 changes: 7 additions & 7 deletions src/Console/LoadCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,17 @@ protected function configure()
->setDescription('Load a path to be managed with Studio')
->addArgument(
'path',
InputArgument::REQUIRED,
'The path where the package files are located'
InputArgument::IS_ARRAY | InputArgument::REQUIRED,
'The path(s) where the package files are located'
);
}

protected function fire()
{
$this->config->addPath(
$path = $this->input->getArgument('path')
);

$this->io->success("Packages matching the path $path will now be loaded by Composer.");
foreach ($this->input->getArgument('path') as $path) {
$this->config->addPath($path);
$this->io->success("Packages matching the path $path will now be loaded by Composer.");
}
}
}
14 changes: 7 additions & 7 deletions src/Console/UnloadCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,17 @@ protected function configure()
->setDescription('Unload a package path from being managed with Studio')
->addArgument(
'path',
InputArgument::REQUIRED,
'The path where the package files are located'
InputArgument::IS_ARRAY | InputArgument::REQUIRED,
'The path(s) where the package files are located'
);
}

protected function fire()
{
$this->config->removePath(
$path = $this->input->getArgument('path')
);

$this->io->success("Packages matching the path $path will no longer be loaded by Composer.");
foreach ($this->input->getArgument('path') as $path) {
$this->config->removePath($path);
$this->io->success("Packages matching the path $path will no longer be loaded by Composer.");
}
}
}

0 comments on commit 1dafb62

Please sign in to comment.