Skip to content

Commit 7302e57

Browse files
committed
Syntax
1 parent 69338ab commit 7302e57

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

eng/scripts/Language-Settings.ps1

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -144,18 +144,11 @@ function Get-rust-PackageInfoFromPackageFile([IO.FileInfo]$pkg, [string]$working
144144
#$pkg will be a FileInfo object for the Cargo.toml file in a package artifact directory
145145

146146
# Create a temporary folder for extraction
147-
$extractionPath = Join-Path [System.IO.Path]::GetTempPath(), ([System.IO.Path]::GetRandomFileName())
147+
$extractionPath = Join-Path ([System.IO.Path]::GetTempPath()), ([System.IO.Path]::GetRandomFileName())
148148
New-Item -ItemType Directory -Path $extractionPath | Out-Null
149149

150-
$originalLocation = Get-Location
151-
try {
152-
Set-Location $extractionPath
153-
tar -xvf $pkg.FullName
154-
}
155-
finally {
156-
Set-Location $originalLocation
157-
}
158-
150+
# Extract the .crate file (which is a tarball) to the temporary folder
151+
tar -xvf $pkg.FullName -C $extractionPath
159152
$cargoTomlPath = Join-Path $extractionPath, $pkg.BaseName, 'Cargo.toml'
160153

161154
Write-Host "Reading package info from $cargoTomlPath"

0 commit comments

Comments
 (0)