Skip to content

Commit ed56a19

Browse files
author
MaksimZhukov
committed
Remove Create-ArtifactDirectories function
1 parent 1a9656d commit ed56a19

File tree

2 files changed

+8
-15
lines changed

2 files changed

+8
-15
lines changed

builders/build-node.ps1

-10
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,6 @@ param(
2828
Import-Module (Join-Path $PSScriptRoot "../helpers" | Join-Path -ChildPath "nix-helpers.psm1") -DisableNameChecking
2929
Import-Module (Join-Path $PSScriptRoot "../helpers" | Join-Path -ChildPath "win-helpers.psm1") -DisableNameChecking
3030

31-
function Create-ArtifactDirectories {
32-
$env:BINARIES_DIRECTORY = Join-Path $env:RUNNER_TEMP "binaries"
33-
New-Item -Path $env:BINARIES_DIRECTORY -ItemType "directory"
34-
35-
$env:ARTIFACT_DIRECTORY = Join-Path $env:RUNNER_TEMP "artifact"
36-
New-Item -Path $env:ARTIFACT_DIRECTORY -ItemType "directory"
37-
}
38-
3931
function Get-NodeBuilder {
4032
<#
4133
.SYNOPSIS
@@ -74,8 +66,6 @@ function Get-NodeBuilder {
7466
return $builder
7567
}
7668

77-
Create-ArtifactDirectories
78-
7969
### Create Node.js builder instance, and build artifact
8070
$Builder = Get-NodeBuilder -Version $Version -Platform $Platform -Architecture $Architecture
8171
$Builder.Build()

builders/node-builder.psm1

+8-5
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ class NodeBuilder {
1919
The location of temporary files that will be used during Node.js package generation.
2020
2121
.PARAMETER WorkFolderLocation
22-
The location of installation files. Using environment BINARIES_DIRECTORY variable value.
22+
The location of installation files.
2323
2424
.PARAMETER ArtifactFolderLocation
25-
The location of generated Node.js artifact. Using environment ARTIFACT_DIRECTORY variable value.
25+
The location of generated Node.js artifact.
2626
2727
.PARAMETER InstallationTemplatesLocation
2828
The location of installation script template. Using "installers" folder from current repository.
@@ -43,9 +43,8 @@ class NodeBuilder {
4343
$this.Architecture = $architecture
4444

4545
$this.TempFolderLocation = [IO.Path]::GetTempPath()
46-
$this.WorkFolderLocation = $env:BINARIES_DIRECTORY
47-
$this.ArtifactFolderLocation = $env:ARTIFACT_DIRECTORY
48-
46+
$this.WorkFolderLocation = Join-Path $env:RUNNER_TEMP "binaries"
47+
$this.ArtifactFolderLocation = Join-Path $env:RUNNER_TEMP "artifact"
4948

5049
$this.InstallationTemplatesLocation = Join-Path -Path $PSScriptRoot -ChildPath "../installers"
5150
}
@@ -87,6 +86,10 @@ class NodeBuilder {
8786
Generates Node.js artifact from downloaded binaries.
8887
#>
8988

89+
Write-Host "Create WorkFolderLocation and ArtifactFolderLocation folders"
90+
New-Item -Path $this.WorkFolderLocation -ItemType "directory"
91+
New-Item -Path $this.ArtifactFolderLocation -ItemType "directory"
92+
9093
Write-Host "Download Node.js $($this.Version) [$($this.Architecture)] executable..."
9194
$binariesArchivePath = $this.Download()
9295

0 commit comments

Comments
 (0)