From 55879a19a1382a9a3677e78a813ef1586c172e7f Mon Sep 17 00:00:00 2001 From: Maxim Lobanov Date: Thu, 23 Apr 2020 06:01:40 +0300 Subject: [PATCH] w --- builders/nix-node-builder.psm1 | 4 ++-- builders/node-builder.psm1 | 2 +- builders/win-node-builder.psm1 | 4 ++-- helpers/nix-helpers.psm1 | 6 +++--- helpers/win-helpers.psm1 | 6 +++--- installers/nix-setup-template.sh | 10 +++------- 6 files changed, 14 insertions(+), 18 deletions(-) diff --git a/builders/nix-node-builder.psm1 b/builders/nix-node-builder.psm1 index 9184469..c56cd80 100644 --- a/builders/nix-node-builder.psm1 +++ b/builders/nix-node-builder.psm1 @@ -40,8 +40,8 @@ class NixNodeBuilder : NodeBuilder { return "${base}/v$($this.Version)/node-v$($this.Version)-$($this.Platform)-$($this.Architecture).tar.gz" } - [void] UnpackBinaries($archivePath) { - Unpack-TarArchive -ArchivePath $archivePath -OutputDirectory $this.ArtifactLocation + [void] ExtractBinaries($archivePath) { + Extract-TarArchive -ArchivePath $archivePath -OutputDirectory $this.ArtifactLocation } [void] CreateInstallationScript() { diff --git a/builders/node-builder.psm1 b/builders/node-builder.psm1 index fe5d0fa..21ef28f 100644 --- a/builders/node-builder.psm1 +++ b/builders/node-builder.psm1 @@ -85,7 +85,7 @@ class NodeBuilder { $binariesArchivePath = $this.Download() Write-Host "Unpack binaries to target directory" - $this.UnpackBinaries($binariesArchivePath) + $this.ExtractBinaries($binariesArchivePath) Write-Host "Create installation script..." $this.CreateInstallationScript() diff --git a/builders/win-node-builder.psm1 b/builders/win-node-builder.psm1 index 1329196..2b7eed9 100644 --- a/builders/win-node-builder.psm1 +++ b/builders/win-node-builder.psm1 @@ -40,8 +40,8 @@ class WinNodeBuilder : NodeBuilder { return "${base}/v$($this.Version)/node-v$($this.Version)-win-$($this.Architecture).7z" } - [void] UnpackBinaries($archivePath) { - Unpack-7ZipArchive -ArchivePath $archivePath -OutputDirectory $this.ArtifactLocation + [void] ExtractBinaries($archivePath) { + Extract-7ZipArchive -ArchivePath $archivePath -OutputDirectory $this.ArtifactLocation } [void] CreateInstallationScript() { diff --git a/helpers/nix-helpers.psm1 b/helpers/nix-helpers.psm1 index de7a57a..6c5bdb4 100644 --- a/helpers/nix-helpers.psm1 +++ b/helpers/nix-helpers.psm1 @@ -2,7 +2,7 @@ .SYNOPSIS Unpack *.tar file #> -function Unpack-TarArchive { +function Extract-TarArchive { param( [Parameter(Mandatory=$true)] [String]$ArchivePath, @@ -10,7 +10,7 @@ function Unpack-TarArchive { [String]$OutputDirectory ) - Write-Debug "Unpack $ArchivePath to $OutputDirectory" - tar -C $OutputDirectory -xzf $ArchivePath + Write-Debug "Extract $ArchivePath to $OutputDirectory" + tar -C $OutputDirectory -xzf $ArchivePath --strip 1 } \ No newline at end of file diff --git a/helpers/win-helpers.psm1 b/helpers/win-helpers.psm1 index 099566f..816b0c0 100644 --- a/helpers/win-helpers.psm1 +++ b/helpers/win-helpers.psm1 @@ -2,7 +2,7 @@ .SYNOPSIS Unpack *.7z file #> -function Unpack-7ZipArchive { +function Extract-7ZipArchive { param( [Parameter(Mandatory=$true)] [String]$ArchivePath, @@ -10,7 +10,7 @@ function Unpack-7ZipArchive { [String]$OutputDirectory ) - Write-Debug "Unpack $ArchivePath to $OutputDirectory" + Write-Debug "Extract $ArchivePath to $OutputDirectory" + Write-Host "7z x $ArchivePath -o$OutputDirectory" 7z x $ArchivePath -o$OutputDirectory - } \ No newline at end of file diff --git a/installers/nix-setup-template.sh b/installers/nix-setup-template.sh index 00b813a..288c279 100644 --- a/installers/nix-setup-template.sh +++ b/installers/nix-setup-template.sh @@ -18,14 +18,10 @@ echo "Create Node.js $NODE_VERSION folder" mkdir -p $NODE_TOOLCACHE_VERSION_ARCH_PATH echo "Copy Node.js binaries to hostedtoolcache folder" -cp ./tool.tar.gz $NODE_TOOLCACHE_VERSION_ARCH_PATH +cp ./* $NODE_TOOLCACHE_VERSION_ARCH_PATH +rm $NODE_TOOLCACHE_VERSION_ARCH_PATH/setup.sh -cd $NODE_TOOLCACHE_VERSION_ARCH_PATH - -echo "Unzip Node.js to $NODE_TOOLCACHE_VERSION_ARCH_PATH" -tar -zxf tool.tar.gz -C . --strip 1 -echo "Node.js unzipped successfully" -rm tool.tar.gz +ls $NODE_TOOLCACHE_VERSION_ARCH_PATH echo "Create complete file" touch $NODE_TOOLCACHE_VERSION_PATH/x64.complete