Remove Create-ArtifactDirectories function

This commit is contained in:
MaksimZhukov 2020-08-24 15:22:05 +03:00
parent 1a9656d766
commit ed56a19091
2 changed files with 8 additions and 15 deletions

View File

@ -28,14 +28,6 @@ param(
Import-Module (Join-Path $PSScriptRoot "../helpers" | Join-Path -ChildPath "nix-helpers.psm1") -DisableNameChecking Import-Module (Join-Path $PSScriptRoot "../helpers" | Join-Path -ChildPath "nix-helpers.psm1") -DisableNameChecking
Import-Module (Join-Path $PSScriptRoot "../helpers" | Join-Path -ChildPath "win-helpers.psm1") -DisableNameChecking Import-Module (Join-Path $PSScriptRoot "../helpers" | Join-Path -ChildPath "win-helpers.psm1") -DisableNameChecking
function Create-ArtifactDirectories {
$env:BINARIES_DIRECTORY = Join-Path $env:RUNNER_TEMP "binaries"
New-Item -Path $env:BINARIES_DIRECTORY -ItemType "directory"
$env:ARTIFACT_DIRECTORY = Join-Path $env:RUNNER_TEMP "artifact"
New-Item -Path $env:ARTIFACT_DIRECTORY -ItemType "directory"
}
function Get-NodeBuilder { function Get-NodeBuilder {
<# <#
.SYNOPSIS .SYNOPSIS
@ -74,8 +66,6 @@ function Get-NodeBuilder {
return $builder return $builder
} }
Create-ArtifactDirectories
### Create Node.js builder instance, and build artifact ### Create Node.js builder instance, and build artifact
$Builder = Get-NodeBuilder -Version $Version -Platform $Platform -Architecture $Architecture $Builder = Get-NodeBuilder -Version $Version -Platform $Platform -Architecture $Architecture
$Builder.Build() $Builder.Build()

View File

@ -19,10 +19,10 @@ class NodeBuilder {
The location of temporary files that will be used during Node.js package generation. The location of temporary files that will be used during Node.js package generation.
.PARAMETER WorkFolderLocation .PARAMETER WorkFolderLocation
The location of installation files. Using environment BINARIES_DIRECTORY variable value. The location of installation files.
.PARAMETER ArtifactFolderLocation .PARAMETER ArtifactFolderLocation
The location of generated Node.js artifact. Using environment ARTIFACT_DIRECTORY variable value. The location of generated Node.js artifact.
.PARAMETER InstallationTemplatesLocation .PARAMETER InstallationTemplatesLocation
The location of installation script template. Using "installers" folder from current repository. The location of installation script template. Using "installers" folder from current repository.
@ -43,9 +43,8 @@ class NodeBuilder {
$this.Architecture = $architecture $this.Architecture = $architecture
$this.TempFolderLocation = [IO.Path]::GetTempPath() $this.TempFolderLocation = [IO.Path]::GetTempPath()
$this.WorkFolderLocation = $env:BINARIES_DIRECTORY $this.WorkFolderLocation = Join-Path $env:RUNNER_TEMP "binaries"
$this.ArtifactFolderLocation = $env:ARTIFACT_DIRECTORY $this.ArtifactFolderLocation = Join-Path $env:RUNNER_TEMP "artifact"
$this.InstallationTemplatesLocation = Join-Path -Path $PSScriptRoot -ChildPath "../installers" $this.InstallationTemplatesLocation = Join-Path -Path $PSScriptRoot -ChildPath "../installers"
} }
@ -87,6 +86,10 @@ class NodeBuilder {
Generates Node.js artifact from downloaded binaries. Generates Node.js artifact from downloaded binaries.
#> #>
Write-Host "Create WorkFolderLocation and ArtifactFolderLocation folders"
New-Item -Path $this.WorkFolderLocation -ItemType "directory"
New-Item -Path $this.ArtifactFolderLocation -ItemType "directory"
Write-Host "Download Node.js $($this.Version) [$($this.Architecture)] executable..." Write-Host "Download Node.js $($this.Version) [$($this.Architecture)] executable..."
$binariesArchivePath = $this.Download() $binariesArchivePath = $this.Download()