Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/NodeJsInstaller.php
Original file line number Diff line number Diff line change
Expand Up @@ -279,10 +279,11 @@ private function extractTo($tarGzFile, $targetDir)
{
// Note: we cannot use PharData class because it does not keeps symbolic links.
// Also, --strip 1 allows us to remove the first directory.
// --no-same-owner is used to extract the files as the current user, even if the current user is root.

$output = $return_var = null;

exec("tar -xvf ".$tarGzFile." -C ".escapeshellarg($targetDir)." --strip 1", $output, $return_var);
exec("tar -xvf ".$tarGzFile." -C ".escapeshellarg($targetDir)." --strip 1 --no-same-owner", $output, $return_var);

if ($return_var !== 0) {
throw new NodeJsInstallerException("An error occurred while untaring NodeJS ($tarGzFile) to $targetDir");
Expand Down