mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-10 10:25:36 +08:00
Fix wrongly using msys2 tar.exe
This commit is contained in:
@@ -468,6 +468,9 @@ class ArtifactExtractor
|
|||||||
|
|
||||||
if ($extname !== 'exe' && !is_dir($target)) {
|
if ($extname !== 'exe' && !is_dir($target)) {
|
||||||
FileSystem::createDir($target);
|
FileSystem::createDir($target);
|
||||||
|
if (!is_dir($target)) {
|
||||||
|
throw new FileSystemException("Failed to create target directory: {$target}");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
match (SystemTarget::getTargetOS()) {
|
match (SystemTarget::getTargetOS()) {
|
||||||
'Windows' => match ($extname) {
|
'Windows' => match ($extname) {
|
||||||
|
|||||||
@@ -132,7 +132,7 @@ class DefaultShell extends Shell
|
|||||||
};
|
};
|
||||||
|
|
||||||
$mute = $this->console_putput ? '' : ' 2>/dev/null';
|
$mute = $this->console_putput ? '' : ' 2>/dev/null';
|
||||||
$cmd = "tar {$compression_flag}xf {$archive_arg} --strip-components {$strip} -C {$target_arg}{$mute}";
|
$cmd = "\"C:\\Windows\\system32\\tar.exe\" {$compression_flag}xf {$archive_arg} --strip-components {$strip} -C {$target_arg}{$mute}";
|
||||||
|
|
||||||
$this->logCommandInfo($cmd);
|
$this->logCommandInfo($cmd);
|
||||||
logger()->debug("[TAR EXTRACT] {$cmd}");
|
logger()->debug("[TAR EXTRACT] {$cmd}");
|
||||||
@@ -187,7 +187,7 @@ class DefaultShell extends Shell
|
|||||||
$extname = FileSystem::extname($archive_path);
|
$extname = FileSystem::extname($archive_path);
|
||||||
match ($extname) {
|
match ($extname) {
|
||||||
'tar' => $this->executeTarExtract($archive_path, $target_path, 'none'),
|
'tar' => $this->executeTarExtract($archive_path, $target_path, 'none'),
|
||||||
'gz', 'tgz', 'xz', 'txz', 'bz2' => $run("{$_7z} x -so {$archive_arg} | tar -f - -x -C {$target_arg} --strip-components 1"),
|
'gz', 'tgz', 'xz', 'txz', 'bz2' => $run("{$_7z} x -so {$archive_arg} | \"C:\\Windows\\system32\\tar.exe\" -f - -x -C {$target_arg} --strip-components 1"),
|
||||||
default => $run("{$_7z} x {$archive_arg} -o{$target_arg} -y{$mute}"),
|
default => $run("{$_7z} x {$archive_arg} -o{$target_arg} -y{$mute}"),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user