refactor musl tool doctor

This commit is contained in:
crazywhalecc
2023-10-22 21:33:09 +08:00
parent 5cfba6e83b
commit 8191444fe9
3 changed files with 75 additions and 70 deletions

View File

@@ -261,10 +261,13 @@ class Downloader
if ($source === null) {
logger()->warning('Source {name} unknown. Skipping.', ['name' => $name]);
return;
}
if (!is_dir(DOWNLOAD_PATH)) {
FileSystem::createDir(DOWNLOAD_PATH);
}
// load lock file
if (!file_exists(DOWNLOAD_PATH . '/.lock.json')) {
$lock = [];

View File

@@ -152,6 +152,9 @@ class FileSystem
if (self::$_extract_hook === []) {
SourcePatcher::init();
}
if (!is_dir(SOURCE_PATH)) {
self::createDir(SOURCE_PATH);
}
if ($move_path !== null) {
$move_path = SOURCE_PATH . '/' . $move_path;
}