This commit is contained in:
Maxim Lobanov 2020-04-23 06:07:49 +03:00
parent 55879a19a1
commit 239f218602
3 changed files with 6 additions and 12 deletions

View File

@ -11,6 +11,5 @@ function Extract-7ZipArchive {
)
Write-Debug "Extract $ArchivePath to $OutputDirectory"
Write-Host "7z x $ArchivePath -o$OutputDirectory"
7z x $ArchivePath -o$OutputDirectory
7z.exe x $ArchivePath -o"$OutputDirectory" -y
}

View File

@ -18,7 +18,7 @@ echo "Create Node.js $NODE_VERSION folder"
mkdir -p $NODE_TOOLCACHE_VERSION_ARCH_PATH
echo "Copy Node.js binaries to hostedtoolcache folder"
cp ./* $NODE_TOOLCACHE_VERSION_ARCH_PATH
cp -R ./* $NODE_TOOLCACHE_VERSION_ARCH_PATH
rm $NODE_TOOLCACHE_VERSION_ARCH_PATH/setup.sh
ls $NODE_TOOLCACHE_VERSION_ARCH_PATH

View File

@ -1,4 +1,5 @@
$ErrorActionPreference = "Stop"
[Version]$Version = "{{__VERSION__}}"
[string]$Architecture = "{{__ARCHITECTURE__}}"
$ArchiveFileName = "tool.7z"
@ -29,16 +30,10 @@ if (-not (Test-Path $NodeToolcacheArchitecturePath)) {
}
Write-Host "Copy Node.js binaries to hostedtoolcache folder"
Copy-Item -Path $ArchiveFileName -Destination $NodeToolcacheArchitecturePath
Copy-Item -Path * -Destination $NodeToolcacheArchitecturePath
Remove-Item $NodeToolcacheArchitecturePath\setup.ps1 -Force | Out-Null
Set-Location $NodeToolcacheArchitecturePath
Write-Host "Unzip Node.js to $NodeToolcacheArchitecturePath"
7z.exe x $ArchiveFileName -o"$TempDirectory" -y | Out-Null
$NodeInnerFolder = Get-Item -Path "$TempDirectory\node-*" | Select-Object -First 1
Get-ChildItem $NodeInnerFolder | Move-Item -Destination $NodeToolcacheArchitecturePath
Write-Host "Node.js unzipped successfully"
Remove-Item $ArchiveFileName -Force | Out-Null
Get-ChildItem $NodeToolcacheArchitecturePath
Write-Host "Create complete file"
New-Item -ItemType File -Path $NodeToolcacheVersionPath -Name "$Architecture.complete" | Out-Null