mirror of
https://github.com/Skyrat-SS13/Skyrat-tg.git
synced 2026-08-24 13:27:32 +01:00
3591 individual conflicts Update build.js Update install_node.sh Update byond.js oh my fucking god hat slow huh holy shit we all fall down 2 more I missed 2900 individual conflicts 2700 Individual conflicts replaces yarn file with tg version, bumping us down to 2200-ish Down to 2000 individual conflicts 140 down mmm aaaaaaaaaaaaaaaaaaa not yt 575 soon 900 individual conflicts 600 individual conflicts, 121 file conflicts im not okay 160 across 19 files 29 in 4 files 0 conflicts, compiletime fix time some minor incap stuff missed ticks weird dupe definition stuff missed ticks 2 incap fixes undefs and pie fix Radio update and some extra minor stuff returns a single override no more dupe definitions, 175 compiletime errors Unticked file fix sound and emote stuff honk and more radio stuff
72 lines
2.0 KiB
PowerShell
72 lines
2.0 KiB
PowerShell
## bootstrap/node_.ps1
|
|
## Downloads a Node version to a cache directory and invokes it.
|
|
|
|
$ErrorActionPreference = "Stop"
|
|
|
|
function Extract-Variable {
|
|
param([string] $Path, [string] $Key)
|
|
foreach ($Line in Get-Content $Path) {
|
|
if ($Line.StartsWith("export $Key=")) {
|
|
return $Line.Substring("export $Key=".Length)
|
|
}
|
|
}
|
|
throw "Couldn't find value for $Key in $Path"
|
|
}
|
|
|
|
function Download-Node {
|
|
if (Test-Path $NodeTarget -PathType Leaf) {
|
|
return
|
|
}
|
|
Write-Output "Downloading Node v$NodeVersion (may take a while)"
|
|
New-Item $NodeTargetDir -ItemType Directory -ErrorAction silentlyContinue | Out-Null
|
|
$WebClient = New-Object Net.WebClient
|
|
$WebClient.DownloadFile($NodeSource, "$NodeTarget.downloading")
|
|
Rename-Item "$NodeTarget.downloading" $NodeTarget
|
|
}
|
|
|
|
## Convenience variables
|
|
$BaseDir = Split-Path $script:MyInvocation.MyCommand.Path
|
|
$Cache = "$BaseDir\.cache"
|
|
if ($Env:TG_BOOTSTRAP_CACHE) {
|
|
$Cache = $Env:TG_BOOTSTRAP_CACHE
|
|
}
|
|
|
|
# Get OS version
|
|
[int]$OSMajor = (Get-WmiObject -Class Win32_OperatingSystem).Version.Split(".")[0]
|
|
|
|
# Set Node version based on OS version
|
|
if ($OSMajor -lt 10) {
|
|
# Anything under Windows 10
|
|
$NodeVersion = Extract-Variable -Path "$BaseDir\..\..\dependencies.sh" -Key "NODE_VERSION_COMPAT"
|
|
}
|
|
else {
|
|
$NodeVersion = Extract-Variable -Path "$BaseDir\..\..\dependencies.sh" -Key "NODE_VERSION_LTS"
|
|
}
|
|
|
|
$NodeSource = "https://nodejs.org/download/release/v$NodeVersion/win-x64/node.exe"
|
|
$NodeTargetDir = "$Cache\node-v$NodeVersion-x64"
|
|
$NodeTarget = "$NodeTargetDir\node.exe"
|
|
|
|
## Just print the path and exit
|
|
if ($Args.length -eq 1 -and $Args[0] -eq "Get-Path") {
|
|
Write-Output "$NodeTargetDir"
|
|
exit 0
|
|
}
|
|
|
|
## Just download node and exit
|
|
if ($Args.length -eq 1 -and $Args[0] -eq "Download-Node") {
|
|
Download-Node
|
|
exit 0
|
|
}
|
|
|
|
## Download node
|
|
Download-Node
|
|
|
|
## Set PATH so that recursive calls find it
|
|
$Env:PATH = "$NodeTargetDir;$ENV:Path"
|
|
|
|
## Invoke Node with all command-line arguments
|
|
$ErrorActionPreference = "Continue"
|
|
& "$NodeTarget" @Args
|
|
exit $LastExitCode
|