diff --git a/src/Commands/BuildCommand.php b/src/Commands/BuildCommand.php index 159b17ea..6ddffd11 100644 --- a/src/Commands/BuildCommand.php +++ b/src/Commands/BuildCommand.php @@ -208,13 +208,15 @@ function () use ($configFile, $config) { private function clear(): void { - File::put($this->app->configPath('app.php'), self::$config); - - File::put($this->app->basePath('box.json'), self::$box); - - self::$config = null; + if (self::$config !== null) { + File::put($this->app->configPath('app.php'), self::$config); + self::$config = null; + } - self::$box = null; + if (self::$box !== null) { + File::put($this->app->basePath('box.json'), self::$box); + self::$box = null; + } } /**