This commit is contained in:
Maxim Lobanov 2020-04-23 06:01:40 +03:00
parent 9f20e91066
commit 55879a19a1
6 changed files with 14 additions and 18 deletions

View File

@ -40,8 +40,8 @@ class NixNodeBuilder : NodeBuilder {
return "${base}/v$($this.Version)/node-v$($this.Version)-$($this.Platform)-$($this.Architecture).tar.gz" return "${base}/v$($this.Version)/node-v$($this.Version)-$($this.Platform)-$($this.Architecture).tar.gz"
} }
[void] UnpackBinaries($archivePath) { [void] ExtractBinaries($archivePath) {
Unpack-TarArchive -ArchivePath $archivePath -OutputDirectory $this.ArtifactLocation Extract-TarArchive -ArchivePath $archivePath -OutputDirectory $this.ArtifactLocation
} }
[void] CreateInstallationScript() { [void] CreateInstallationScript() {

View File

@ -85,7 +85,7 @@ class NodeBuilder {
$binariesArchivePath = $this.Download() $binariesArchivePath = $this.Download()
Write-Host "Unpack binaries to target directory" Write-Host "Unpack binaries to target directory"
$this.UnpackBinaries($binariesArchivePath) $this.ExtractBinaries($binariesArchivePath)
Write-Host "Create installation script..." Write-Host "Create installation script..."
$this.CreateInstallationScript() $this.CreateInstallationScript()

View File

@ -40,8 +40,8 @@ class WinNodeBuilder : NodeBuilder {
return "${base}/v$($this.Version)/node-v$($this.Version)-win-$($this.Architecture).7z" return "${base}/v$($this.Version)/node-v$($this.Version)-win-$($this.Architecture).7z"
} }
[void] UnpackBinaries($archivePath) { [void] ExtractBinaries($archivePath) {
Unpack-7ZipArchive -ArchivePath $archivePath -OutputDirectory $this.ArtifactLocation Extract-7ZipArchive -ArchivePath $archivePath -OutputDirectory $this.ArtifactLocation
} }
[void] CreateInstallationScript() { [void] CreateInstallationScript() {

View File

@ -2,7 +2,7 @@
.SYNOPSIS .SYNOPSIS
Unpack *.tar file Unpack *.tar file
#> #>
function Unpack-TarArchive { function Extract-TarArchive {
param( param(
[Parameter(Mandatory=$true)] [Parameter(Mandatory=$true)]
[String]$ArchivePath, [String]$ArchivePath,
@ -10,7 +10,7 @@ function Unpack-TarArchive {
[String]$OutputDirectory [String]$OutputDirectory
) )
Write-Debug "Unpack $ArchivePath to $OutputDirectory" Write-Debug "Extract $ArchivePath to $OutputDirectory"
tar -C $OutputDirectory -xzf $ArchivePath tar -C $OutputDirectory -xzf $ArchivePath --strip 1
} }

View File

@ -2,7 +2,7 @@
.SYNOPSIS .SYNOPSIS
Unpack *.7z file Unpack *.7z file
#> #>
function Unpack-7ZipArchive { function Extract-7ZipArchive {
param( param(
[Parameter(Mandatory=$true)] [Parameter(Mandatory=$true)]
[String]$ArchivePath, [String]$ArchivePath,
@ -10,7 +10,7 @@ function Unpack-7ZipArchive {
[String]$OutputDirectory [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 7z x $ArchivePath -o$OutputDirectory
} }

View File

@ -18,14 +18,10 @@ echo "Create Node.js $NODE_VERSION folder"
mkdir -p $NODE_TOOLCACHE_VERSION_ARCH_PATH mkdir -p $NODE_TOOLCACHE_VERSION_ARCH_PATH
echo "Copy Node.js binaries to hostedtoolcache folder" 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 ls $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
echo "Create complete file" echo "Create complete file"
touch $NODE_TOOLCACHE_VERSION_PATH/x64.complete touch $NODE_TOOLCACHE_VERSION_PATH/x64.complete