Add pack-lib tests

This commit is contained in:
crazywhalecc
2024-07-07 21:34:04 +08:00
committed by Jerry Ma
parent c6a22fbd14
commit bdc6b2807a
3 changed files with 91 additions and 1 deletions

View File

@@ -404,7 +404,7 @@ class Downloader
$lock = json_decode(FileSystem::readFile(DOWNLOAD_PATH . '/.lock.json'), true) ?? [];
}
// If lock file exists, skip downloading
if (isset($lock[$name]) && !$force) {
if (isset($lock[$name]) && !$force && ($lock[$name]['lock_as'] ?? SPC_LOCK_SOURCE) === $lock_as) {
if ($lock[$name]['source_type'] === 'archive' && file_exists(DOWNLOAD_PATH . '/' . $lock[$name]['filename'])) {
logger()->notice("source [{$name}] already downloaded: " . $lock[$name]['filename']);
return;