mirror of
https://github.com/IvarK/AntimatterDimensionsSourceCode.git
synced 2025-02-16 15:40:16 +00:00
Merge branch 'master' into earth/add-unsupported-browser-message
This commit is contained in:
commit
cefdf275b3
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,4 +1,5 @@
|
||||
dist
|
||||
.tmp
|
||||
|
||||
.vscode
|
||||
.idea
|
||||
|
39
build/check-npm.js
Normal file
39
build/check-npm.js
Normal file
@ -0,0 +1,39 @@
|
||||
/* eslint-disable no-bitwise */
|
||||
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
const proc = require("child_process");
|
||||
|
||||
function getHash(string) {
|
||||
let hash = 0;
|
||||
for (let i = 0; i < string.length; i++) {
|
||||
const char = string.charCodeAt(i);
|
||||
hash = ((hash << 5) - hash) + char;
|
||||
// Convert to 32bit integer
|
||||
hash &= hash;
|
||||
}
|
||||
return hash.toString();
|
||||
}
|
||||
|
||||
const hashPath = path.resolve(__dirname, "../.tmp/package-lock.json.hash");
|
||||
let currentHash = undefined;
|
||||
if (fs.existsSync(hashPath)) {
|
||||
currentHash = fs.readFileSync(hashPath, { encoding: "utf-8" });
|
||||
}
|
||||
|
||||
const packageLockPath = path.resolve(__dirname, "../package-lock.json");
|
||||
const packageLockContents = fs.readFileSync(packageLockPath, { encoding: "utf-8" });
|
||||
const newHash = getHash(packageLockContents);
|
||||
|
||||
if (newHash !== currentHash) {
|
||||
const tmpPath = path.resolve(__dirname, "../.tmp");
|
||||
if (!fs.existsSync(tmpPath)) {
|
||||
fs.mkdirSync(tmpPath);
|
||||
}
|
||||
|
||||
// eslint-disable-next-line no-console
|
||||
console.log("package-lock.json changes were detected");
|
||||
console.log("Running 'npm ci' (this might take a while)...");
|
||||
proc.execSync("npm ci");
|
||||
fs.writeFileSync(hashPath, newHash, {});
|
||||
}
|
@ -343,6 +343,7 @@ GameStorage.migrations = {
|
||||
},
|
||||
|
||||
adjustWhy(player) {
|
||||
player.requirementChecks.permanent.singleTickspeed = player.why ?? 0;
|
||||
delete player.why;
|
||||
},
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
{
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"serve": "vue-cli-service serve",
|
||||
"serve": "node build/check-npm.js && vue-cli-service serve",
|
||||
"build": "vue-cli-service build && node build/post-build.js",
|
||||
"lint": "vue-cli-service lint",
|
||||
"supportedBrowsers": "(echo export const supportedBrowsers = && browserslist-useragent-regexp --allowHigherVersions) > supportedBrowsers.js"
|
||||
|
Loading…
Reference in New Issue
Block a user