change phar writable checker to FileSystem

This commit is contained in:
Jerry
2023-02-01 16:59:54 +08:00
parent 60382a98f6
commit 2d2660c8f3
5 changed files with 28 additions and 16 deletions

View File

@@ -6,6 +6,7 @@ namespace ZM\Command;
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Input\InputOption;
use ZM\Exception\FileSystemException;
use ZM\Store\FileSystem;
use ZM\Store\PharHelper;
@@ -27,6 +28,7 @@ class BuildCommand extends Command
/**
* @throws \PharException
* @throws FileSystemException
*/
protected function handle(): int
{
@@ -40,7 +42,7 @@ class BuildCommand extends Command
}
$target = $build_dir . '/' . $target;
// 确认 Phar 文件可以写入
PharHelper::ensurePharFileWritable($target);
FileSystem::ensureFileWritable($target);
$this->comment("目标文件:{$target}");