Skip to content

Commit

Permalink
Reimplements node compatibility mode (tgstation#83141)
Browse files Browse the repository at this point in the history
## About The Pull Request
Puts a switch inside our build tools that will download the appropriate
node version based on your OS.

tgstation#82334

## Why It's Good For The Game
Closes tgstation#83076
Allows players to play the game
  • Loading branch information
jlsnow301 authored May 11, 2024
1 parent cff1cb0 commit c0133e4
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
5 changes: 3 additions & 2 deletions dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ export BYOND_MINOR=1637
export RUST_G_VERSION=3.1.0

#node version
export NODE_VERSION=20
export NODE_VERSION_LTS=20.12.0
export NODE_VERSION_LTS=20.13.0
# compatiblility mode MUST work with windows 7
export NODE_VERSION_COMPAT=20.2.0

# SpacemanDMM git tag
export SPACEMAN_DMM_VERSION=suite-1.8
Expand Down
13 changes: 12 additions & 1 deletion tools/bootstrap/node_.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,18 @@ if ($Env:TG_BOOTSTRAP_CACHE) {
$Cache = $Env:TG_BOOTSTRAP_CACHE
}

$NodeVersion = Extract-Variable -Path "$BaseDir\..\..\dependencies.sh" -Key "NODE_VERSION_LTS"
# Get OS version
$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"
Expand Down
4 changes: 2 additions & 2 deletions tools/ci/install_node.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ source dependencies.sh

if [[ -e ~/.nvm/nvm.sh ]]; then
source ~/.nvm/nvm.sh
nvm install $NODE_VERSION
nvm use $NODE_VERSION
nvm install $NODE_VERSION_COMPAT
nvm use $NODE_VERSION_COMPAT
fi

0 comments on commit c0133e4

Please sign in to comment.