fix --with-clean to make it work

This commit is contained in:
crazywhalecc 2023-10-14 11:33:17 +08:00 committed by Jerry Ma
parent 30213da70a
commit c1e9cd2ea3
2 changed files with 6 additions and 1 deletions

View File

@ -7,6 +7,7 @@ namespace SPC\command;
use SPC\builder\BuilderProvider;
use SPC\exception\ExceptionHandler;
use SPC\exception\WrongUsageException;
use SPC\store\FileSystem;
use SPC\store\SourcePatcher;
use SPC\util\DependencyUtil;
use SPC\util\LicenseDumper;
@ -70,6 +71,10 @@ class BuildCliCommand extends BuildCommand
logger()->warning('some extensions will be enabled due to dependencies: ' . implode(',', $not_included));
}
sleep(2);
if ($this->input->getOption('with-clean')) {
logger()->info('Cleaning source dir...');
FileSystem::removeDir(SOURCE_PATH);
}
// compile libraries
$builder->buildLibs($libraries);
// check extensions

View File

@ -28,7 +28,7 @@ abstract class BuildCommand extends BaseCommand
break;
}
$this->addOption('with-clean', null, null, 'fresh build, `make clean` before `make`');
$this->addOption('with-clean', null, null, 'fresh build, remove `source` dir before `make`');
$this->addOption('bloat', null, null, 'add all libraries into binary');
}
}