mirror of
https://github.com/Citadel-Station-13/Citadel-Station-13-RP.git
synced 2026-08-25 14:46:30 +01:00
<!-- Write **BELOW** The Headers and **ABOVE** The comments else it may not be viewable. --> <!-- You can view Contributing.MD for a detailed description of the pull request process. --> ## About The Pull Request Title. Updates CI & Linting Reruns tgm on maps to trim duplicate/unused keys and random whitespaces <!-- Describe The Pull Request. Please be sure every change is documented or this can delay review and even discourage maintainers from merging your PR! --> ## Why It's Good For The Game <!-- Argue for the merits of your changes and how they benefit the game, especially if they are controversial and/or far reaching. If you can't actually explain WHY what you are doing will improve the game, then it probably isn't good for the game in the first place. --> ## Changelog <!-- If your PR modifies aspects of the game that can be concretely observed by players or admins you should add a changelog. If your change does NOT meet this description, remove this section. Be sure to properly mark your PRs to prevent unnecessary GBP loss. You can read up on GBP and it's effects on PRs in the tgstation guides for contributors. Please note that maintainers freely reserve the right to remove and add tags should they deem it appropriate. You can attempt to finagle the system all you want, but it's best to shoot for clear communication right off the bat. --> <!-- Both 🆑's are required for the changelog to work! You can put your name to the right of the first 🆑 if you want to overwrite your GitHub username as author ingame. --> <!-- You can use multiple of the same prefix (they're only used for the icon ingame) and delete the unneeded ones. Despite some of the tags, changelogs should generally represent how a player might be affected by the changes rather than a summary of the PR's contents. -->
74 lines
2.3 KiB
Bash
Executable File
74 lines
2.3 KiB
Bash
Executable File
#!/bin/sh
|
|
# bootstrap/node
|
|
#
|
|
# Node-finding script for all `sh` environments, including Linux, MSYS2,
|
|
# Git for Windows, and GitHub Desktop. Invokable from CLI or automation.
|
|
#
|
|
# If a node.exe installed by `node_.ps1` is present, it will be used.
|
|
# Otherwise, this script requires a system `node` to be provided.
|
|
set -e
|
|
|
|
# Convenience variables
|
|
Bootstrap="$(dirname "$0")"
|
|
Cache="$Bootstrap/.cache"
|
|
if [ "$TG_BOOTSTRAP_CACHE" ]; then
|
|
Cache="$TG_BOOTSTRAP_CACHE"
|
|
fi
|
|
OldPWD="$PWD"
|
|
cd "$Bootstrap/../.."
|
|
. ./dependencies.sh # sets NODE_VERSION_LTS
|
|
cd "$OldPWD"
|
|
NodeVersion="$NODE_VERSION_LTS"
|
|
NodeFullVersion="node-v$NodeVersion-win-x64"
|
|
NodeDir="$Cache/$NodeFullVersion"
|
|
NodeExe="$NodeDir/node.exe"
|
|
is_vendored="1"
|
|
|
|
# If a bootstrapped Node is not present, search on $PATH.
|
|
if [ "$(uname)" = "Linux" ] || [ ! -f "$NodeExe" ]; then
|
|
if [ "$TG_BOOTSTRAP_NODE_LINUX" ]; then
|
|
NodeFullVersion="node-v$NodeVersion-linux-x64"
|
|
NodeDir="$Cache/$NodeFullVersion/bin"
|
|
NodeExe="$NodeDir/node"
|
|
|
|
if [ ! -f "$NodeExe" ]; then
|
|
mkdir -p "$Cache"
|
|
Archive="$(realpath "$Cache/node-v$NodeVersion.tar.gz")"
|
|
curl "https://nodejs.org/download/release/v$NodeVersion/$NodeFullVersion.tar.gz" -o "$Archive"
|
|
(cd "$Cache" && tar xf "$Archive")
|
|
fi
|
|
elif command -v node >/dev/null 2>&1; then
|
|
NodeExe="node"
|
|
is_vendored="0"
|
|
else
|
|
echo
|
|
if command -v apt-get >/dev/null 2>&1; then
|
|
# Ubuntu advice
|
|
echo "Please install Node using your system's package manager:"
|
|
echo " sudo apt-get install nodejs"
|
|
elif uname | grep -q MSYS; then
|
|
# MSYS2 (not packaged) or Git for Windows advice
|
|
echo "Please run bootstrap/node.bat instead of bootstrap/node once"
|
|
echo "to install Node automatically, or install it from https://nodejs.org/"
|
|
elif command -v pacman >/dev/null 2>&1; then
|
|
# Arch advice
|
|
echo "Please install Node using your system's package manager:"
|
|
echo " sudo pacman -S nodejs"
|
|
else
|
|
# Generic advice
|
|
echo "Please install Node from https://nodejs.org/ or using your system's package manager."
|
|
fi
|
|
echo
|
|
exit 1
|
|
fi
|
|
fi
|
|
|
|
# Invoke Node with all command-line arguments
|
|
if [ "$is_vendored" = "1" ]; then
|
|
PATH="$(readlink -f "$NodeDir"):$PATH"
|
|
echo "Using vendored Node $("$NodeExe" --version)"
|
|
else
|
|
echo "Using system-wide Node $("$NodeExe" --version)"
|
|
fi
|
|
exec "$NodeExe" "$@"
|