refactor lock file constant out

This commit is contained in:
DubbleClick
2025-06-19 09:50:38 +07:00
parent 4977286936
commit c2d6b9ad2c
5 changed files with 9 additions and 6 deletions

View File

@@ -12,6 +12,7 @@ use SPC\exception\RuntimeException;
use SPC\exception\WrongUsageException;
use SPC\store\Config;
use SPC\store\Downloader;
use SPC\store\LockFile;
use SPC\util\DependencyUtil;
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Input\InputArgument;
@@ -301,7 +302,7 @@ class DownloadCommand extends BaseCommand
throw new WrongUsageException('Windows currently does not support --from-zip !');
}
if (!file_exists(DOWNLOAD_PATH . '/.lock.json')) {
if (!file_exists(LockFile::LOCK_FILE)) {
throw new RuntimeException('.lock.json not exist in "downloads/"');
}
} catch (RuntimeException $e) {