mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-21 15:55:36 +08:00
Use PatchException instead of ExecutionException for patchFile
This commit is contained in:
@@ -8,6 +8,7 @@ use SPC\builder\BuilderBase;
|
||||
use SPC\builder\linux\SystemUtil;
|
||||
use SPC\builder\unix\UnixBuilderBase;
|
||||
use SPC\builder\windows\WindowsBuilder;
|
||||
use SPC\exception\ExecutionException;
|
||||
use SPC\exception\FileSystemException;
|
||||
use SPC\exception\PatchException;
|
||||
use SPC\util\SPCTarget;
|
||||
@@ -190,6 +191,7 @@ class SourcePatcher
|
||||
*/
|
||||
public static function patchFile(string $patch_name, string $cwd, bool $reverse = false): bool
|
||||
{
|
||||
try {
|
||||
if (FileSystem::isRelativePath($patch_name)) {
|
||||
$patch_file = ROOT_DIR . "/src/globals/patch/{$patch_name}";
|
||||
} else {
|
||||
@@ -230,6 +232,10 @@ class SourcePatcher
|
||||
|
||||
f_passthru($apply_cmd);
|
||||
return true;
|
||||
} catch (ExecutionException $e) {
|
||||
// If patch failed, throw exception
|
||||
throw new PatchException($patch_name, "Patch file [{$patch_name}] failed to apply", previous: $e);
|
||||
}
|
||||
}
|
||||
|
||||
public static function patchOpenssl11Darwin(): bool
|
||||
|
||||
Reference in New Issue
Block a user