mirror of
https://github.com/actions/runner-images.git
synced 2025-12-15 22:26:56 +00:00
[Windows] Apply code style rules to Windows scripts (#8957)
* Apply code style rules to Windows scripts * Fix typo * Fix configure-toolset script * Fix parameters in Msys2 installation script * Improve log readability * Remove broken exit code validation
This commit is contained in:
committed by
GitHub
parent
76d6f0f574
commit
7fe65a2204
@@ -4,24 +4,24 @@
|
||||
## Must run after python is configured
|
||||
################################################################################
|
||||
|
||||
$PrefixPath = 'C:\npm\prefix'
|
||||
$CachePath = 'C:\npm\cache'
|
||||
$prefixPath = 'C:\npm\prefix'
|
||||
$cachePath = 'C:\npm\cache'
|
||||
|
||||
New-Item -Path $PrefixPath -Force -ItemType Directory
|
||||
New-Item -Path $CachePath -Force -ItemType Directory
|
||||
New-Item -Path $prefixPath -Force -ItemType Directory
|
||||
New-Item -Path $cachePath -Force -ItemType Directory
|
||||
|
||||
$defaultVersion = (Get-ToolsetContent).node.default
|
||||
$versionToInstall = Resolve-ChocoPackageVersion -PackageName "nodejs" -TargetVersion $defaultVersion
|
||||
|
||||
Install-ChocoPackage nodejs -ArgumentList "--version=$versionToInstall"
|
||||
Install-ChocoPackage "nodejs" -ArgumentList "--version=$versionToInstall"
|
||||
|
||||
Add-MachinePathItem $PrefixPath
|
||||
Add-MachinePathItem $prefixPath
|
||||
Update-Environment
|
||||
|
||||
[Environment]::SetEnvironmentVariable("npm_config_prefix", $PrefixPath, "Machine")
|
||||
$env:npm_config_prefix = $PrefixPath
|
||||
[Environment]::SetEnvironmentVariable("npm_config_prefix", $prefixPath, "Machine")
|
||||
$env:npm_config_prefix = $prefixPath
|
||||
|
||||
npm config set cache $CachePath --global
|
||||
npm config set cache $cachePath --global
|
||||
npm config set registry https://registry.npmjs.org/
|
||||
|
||||
$globalNpmPackages = (Get-ToolsetContent).npm.global_packages
|
||||
|
||||
Reference in New Issue
Block a user