mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-18 04:44:53 +08:00
Add target dir to extract hook
This commit is contained in:
parent
9463cf94ca
commit
1d78a231db
@ -195,7 +195,7 @@ class FileSystem
|
||||
}
|
||||
try {
|
||||
self::extractArchive($filename, $target);
|
||||
self::emitSourceExtractHook($name);
|
||||
self::emitSourceExtractHook($name, $target);
|
||||
} catch (RuntimeException $e) {
|
||||
if (PHP_OS_FAMILY === 'Windows') {
|
||||
f_passthru('rmdir /s /q ' . $target);
|
||||
@ -518,10 +518,10 @@ class FileSystem
|
||||
return file_put_contents($filename, $file);
|
||||
}
|
||||
|
||||
private static function emitSourceExtractHook(string $name): void
|
||||
private static function emitSourceExtractHook(string $name, string $target): void
|
||||
{
|
||||
foreach ((self::$_extract_hook[$name] ?? []) as $hook) {
|
||||
if ($hook($name) === true) {
|
||||
if ($hook($name, $target) === true) {
|
||||
logger()->info('Patched source [' . $name . '] after extracted');
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user