From c1e9cd2ea380a46f2e20ebcf4c5b3059feb40e91 Mon Sep 17 00:00:00 2001 From: crazywhalecc Date: Sat, 14 Oct 2023 11:33:17 +0800 Subject: [PATCH] fix `--with-clean` to make it work --- src/SPC/command/BuildCliCommand.php | 5 +++++ src/SPC/command/BuildCommand.php | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/SPC/command/BuildCliCommand.php b/src/SPC/command/BuildCliCommand.php index 00be7559..db08187f 100644 --- a/src/SPC/command/BuildCliCommand.php +++ b/src/SPC/command/BuildCliCommand.php @@ -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 diff --git a/src/SPC/command/BuildCommand.php b/src/SPC/command/BuildCommand.php index 8a721189..98bb77b3 100644 --- a/src/SPC/command/BuildCommand.php +++ b/src/SPC/command/BuildCommand.php @@ -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'); } }