From 239f2186025c5acefd907de22e797ddb62689df2 Mon Sep 17 00:00:00 2001 From: Maxim Lobanov Date: Thu, 23 Apr 2020 06:07:49 +0300 Subject: [PATCH] www --- helpers/win-helpers.psm1 | 3 +-- installers/nix-setup-template.sh | 2 +- installers/win-setup-template.ps1 | 13 ++++--------- 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/helpers/win-helpers.psm1 b/helpers/win-helpers.psm1 index 816b0c0..38f797b 100644 --- a/helpers/win-helpers.psm1 +++ b/helpers/win-helpers.psm1 @@ -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 } \ No newline at end of file diff --git a/installers/nix-setup-template.sh b/installers/nix-setup-template.sh index 288c279..dd6bc70 100644 --- a/installers/nix-setup-template.sh +++ b/installers/nix-setup-template.sh @@ -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 diff --git a/installers/win-setup-template.ps1 b/installers/win-setup-template.ps1 index e9bb2fd..2011d8c 100644 --- a/installers/win-setup-template.ps1 +++ b/installers/win-setup-template.ps1 @@ -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 \ No newline at end of file