mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-18 04:44:53 +08:00
Code style fix and comment addition
This commit is contained in:
parent
3c0eb68c70
commit
c6a22fbd14
@ -45,7 +45,7 @@ abstract class LibraryBase
|
||||
$lock = json_decode(FileSystem::readFile(DOWNLOAD_PATH . '/.lock.json'), true) ?? [];
|
||||
$source = Config::getLib(static::NAME, 'source');
|
||||
// if source is locked as pre-built, we just tryInstall it
|
||||
if (isset($lock[$source]) && $lock[$source]['lock_as'] === SPC_LOCK_PRE_BUILT) {
|
||||
if (isset($lock[$source]) && ($lock[$source]['lock_as'] ?? SPC_LOCK_SOURCE) === SPC_LOCK_PRE_BUILT) {
|
||||
return $this->tryInstall($lock[$source]['filename'], $force);
|
||||
}
|
||||
return $this->tryBuild($force);
|
||||
|
||||
@ -147,7 +147,7 @@ class BuildCliCommand extends BuildCommand
|
||||
$builder->proveExts($extensions);
|
||||
// validate libs and exts
|
||||
$builder->validateLibsAndExts();
|
||||
// build libraries
|
||||
// build or install libraries
|
||||
$builder->setupLibs();
|
||||
|
||||
if ($this->input->getOption('with-clean')) {
|
||||
|
||||
@ -64,7 +64,7 @@ class PackLibCommand extends BuildCommand
|
||||
FileSystem::writeFile(WORKING_DIR . '/packlib_files.txt', implode("\n", $increase_files));
|
||||
// pack
|
||||
$filename = WORKING_DIR . '/dist/' . $lib->getName() . '-' . arch2gnu(php_uname('m')) . '-' . strtolower(PHP_OS_FAMILY) . '.' . Config::getPreBuilt('suffix');
|
||||
f_passthru('tar -czf ' . $filename . ' -T ' . WORKING_DIR . '/packlib_files.txt -C ' . WORKING_DIR);
|
||||
f_passthru('tar -czf ' . $filename . ' -T ' . WORKING_DIR . '/packlib_files.txt');
|
||||
logger()->info('Pack library ' . $lib->getName() . ' to ' . $filename . ' complete.');
|
||||
}
|
||||
}
|
||||
|
||||
@ -558,7 +558,6 @@ class Downloader
|
||||
try {
|
||||
f_passthru($cmd);
|
||||
} catch (RuntimeException $e) {
|
||||
var_dump($e->getCode());
|
||||
if ($e->getCode() === 2 || $e->getCode() === -1073741510) {
|
||||
throw new WrongUsageException('Keyboard interrupted, download failed !');
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user