mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-07 00:35:41 +08:00
extra readline check to make sure -a works
This commit is contained in:
@@ -5,6 +5,7 @@ declare(strict_types=1);
|
||||
namespace SPC\builder\extension;
|
||||
|
||||
use SPC\builder\Extension;
|
||||
use SPC\exception\ValidationException;
|
||||
use SPC\store\FileSystem;
|
||||
use SPC\util\CustomExt;
|
||||
use SPC\util\SPCTarget;
|
||||
@@ -36,6 +37,15 @@ class readline extends Extension
|
||||
parent::buildUnixShared();
|
||||
}
|
||||
|
||||
public function runCliCheckUnix(): void
|
||||
{
|
||||
parent::runCliCheckUnix();
|
||||
[$ret, $out] = shell()->execWithResult('printf "exit\n" | ' . BUILD_BIN_PATH . '/php -a');
|
||||
if ($ret !== 0 || !str_contains(implode("\n", $out), 'Interactive shell')) {
|
||||
throw new ValidationException("readline extension failed sanity check. Code: {$ret}, output: " . implode("\n", $out));
|
||||
}
|
||||
}
|
||||
|
||||
public static function patchCliLinux(bool $patch): void
|
||||
{
|
||||
if (SPCTarget::getTargetOS() === 'Linux' && SPCTarget::isStatic() && $patch) {
|
||||
|
||||
Reference in New Issue
Block a user