File tree Expand file tree Collapse file tree 1 file changed +23
-1
lines changed Expand file tree Collapse file tree 1 file changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -142,7 +142,29 @@ function Get-rust-AdditionalValidationPackagesFromPackageSet ($packagesWithChang
142142# $GetPackageInfoFromPackageFileFn = "Get-${Language}-PackageInfoFromPackageFile"
143143function Get-rust-PackageInfoFromPackageFile ([IO.FileInfo ]$pkg , [string ]$workingDirectory ) {
144144 # $pkg will be a FileInfo object for the Cargo.toml file in a package artifact directory
145- $package = cargo read-manifest -- manifest- path $pkg.FullName | ConvertFrom-Json
145+
146+ # Create a temporary folder for extraction
147+ $extractionPath = Join-Path [System.IO.Path ]::GetTempPath(), ([System.IO.Path ]::GetRandomFileName())
148+ New-Item - ItemType Directory - Path $extractionPath | Out-Null
149+
150+ $originalLocation = Get-Location
151+ try {
152+ Set-Location $extractionPath
153+ tar - xvf $pkg.FullName
154+ }
155+ finally {
156+ Set-Location $originalLocation
157+ }
158+
159+ $cargoTomlPath = Join-Path $extractionPath , $pkg.BaseName , ' Cargo.toml'
160+
161+ Write-Host " Reading package info from $cargoTomlPath "
162+ if (! (Test-Path $cargoTomlPath )) {
163+ LogError " The Cargo.toml file was not found in the package artifact at $cargoTomlPath "
164+ throw " error"
165+ }
166+
167+ $package = cargo read-manifest -- manifest- path $cargoTomlPath | ConvertFrom-Json
146168
147169 $packageName = $package.name
148170 $packageVersion = $package.version
You can’t perform that action at this time.
0 commit comments