Implement #75
This commit is contained in:
@@ -3,8 +3,11 @@
|
|||||||
"version": "3.0.0",
|
"version": "3.0.0",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
|
"//": "If you add or change the names of destinations in screeps.json, make sure you update these scripts to reflect the changes",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "echo \"Error: no test specified\" && exit 1"
|
"push-main": "rollup -c --dest main",
|
||||||
|
"push-sim": "rollup -c --dest sim",
|
||||||
|
"push-pserver": "rollup -c --dest pserver"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
|||||||
@@ -6,6 +6,16 @@ import commonjs from "rollup-plugin-commonjs";
|
|||||||
import screeps from "rollup-plugin-screeps";
|
import screeps from "rollup-plugin-screeps";
|
||||||
import typescript from "rollup-plugin-typescript2";
|
import typescript from "rollup-plugin-typescript2";
|
||||||
|
|
||||||
|
const config = require("./screeps");
|
||||||
|
|
||||||
|
let cfg;
|
||||||
|
const i = process.argv.indexOf("--dest") + 1;
|
||||||
|
if (i == 0) {
|
||||||
|
console.log("No destination specified - code will be compiled but not uploaded");
|
||||||
|
} else if (i >= process.argv.length || (cfg = config[process.argv[i]]) == null) {
|
||||||
|
throw new Error("Invalid upload destination");
|
||||||
|
}
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
input: "src/main.ts",
|
input: "src/main.ts",
|
||||||
output: {
|
output: {
|
||||||
@@ -20,6 +30,6 @@ export default {
|
|||||||
resolve(),
|
resolve(),
|
||||||
commonjs(),
|
commonjs(),
|
||||||
typescript({tsconfig: "./tsconfig.json"}),
|
typescript({tsconfig: "./tsconfig.json"}),
|
||||||
screeps({configFile: "./screeps.json"})
|
screeps({config: cfg, dryRun: cfg == null})
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,29 @@
|
|||||||
{
|
{
|
||||||
"email": "you@provider.tld",
|
"main": {
|
||||||
"password": "Password",
|
"email": "you@provider.tld",
|
||||||
"protocol": "https",
|
"password": "Password",
|
||||||
"hostname": "screeps.com",
|
"protocol": "https",
|
||||||
"port": 443,
|
"hostname": "screeps.com",
|
||||||
"path": "/",
|
"port": 443,
|
||||||
"branch": "auto"
|
"path": "/",
|
||||||
|
"branch": "main"
|
||||||
|
},
|
||||||
|
"sim": {
|
||||||
|
"email": "you@provider.tld",
|
||||||
|
"password": "Password",
|
||||||
|
"protocol": "https",
|
||||||
|
"hostname": "screeps.com",
|
||||||
|
"port": 443,
|
||||||
|
"path": "/",
|
||||||
|
"branch": "sim"
|
||||||
|
},
|
||||||
|
"pserver": {
|
||||||
|
"email": "username",
|
||||||
|
"password": "Password",
|
||||||
|
"protocol": "http",
|
||||||
|
"hostname": "1.2.3.4",
|
||||||
|
"port": 21025,
|
||||||
|
"path": "/",
|
||||||
|
"branch": "main"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user