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"
}
[void] UnpackBinaries($archivePath) {
Unpack-TarArchive -ArchivePath $archivePath -OutputDirectory $this.ArtifactLocation
[void] ExtractBinaries($archivePath) {
Extract-TarArchive -ArchivePath $archivePath -OutputDirectory $this.ArtifactLocation
}
[void] CreateInstallationScript() {

View File

@ -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()

View File

@ -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() {

View File

@ -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
}

View File

@ -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
}

View File

@ -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