Misc cleanup, fix --force logic for build command
This commit is contained in:
@@ -34,16 +34,17 @@ class PackageBuildCommand extends BaseCommand
|
||||
{
|
||||
$registry = $input->getOption("publish");
|
||||
|
||||
$builder = new PackageBuilder($output);
|
||||
|
||||
$version = $input->getArgument("version");
|
||||
$force = $input->getOption("force");
|
||||
|
||||
$builder = new PackageBuilder($output);
|
||||
|
||||
$project = ProjectInfo::read(version:$version);
|
||||
|
||||
if ($registry && file_exists($project->filename) && !$input->getOption("force")) {
|
||||
if (file_exists($project->filename) && !$force) {
|
||||
$output->writeln("<fg=black;bg=yellow>Package file already exists. Pass --force to rebuild it.</>");
|
||||
} else {
|
||||
$builder->build($project, $input->getOption("dirty"), $input->getOption("force"));
|
||||
$builder->build($project, $input->getOption("dirty"), $force);
|
||||
}
|
||||
|
||||
if ($registry) {
|
||||
|
||||
@@ -34,7 +34,7 @@ class PackageBuilder
|
||||
$filename = $currentDir . "/" . $project->filename;
|
||||
|
||||
if (file_exists($filename) && !$overwrite) {
|
||||
throw new \Exception("The package file already exists, pass --force to overwrite it.");
|
||||
throw new \Exception("The package file already exists");
|
||||
}
|
||||
|
||||
if (!$dirty) {
|
||||
|
||||
Reference in New Issue
Block a user