This commit is contained in:
apemanzilla
2017-11-26 13:49:53 -05:00
parent fb83e12a0b
commit 3d0359e89e
3 changed files with 42 additions and 9 deletions

View File

@@ -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",

View File

@@ -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})
] ]
} }

View File

@@ -1,9 +1,29 @@
{ {
"main": {
"email": "you@provider.tld", "email": "you@provider.tld",
"password": "Password", "password": "Password",
"protocol": "https", "protocol": "https",
"hostname": "screeps.com", "hostname": "screeps.com",
"port": 443, "port": 443,
"path": "/", "path": "/",
"branch": "auto" "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"
}
} }