Implement #75
This commit is contained in:
@@ -3,8 +3,11 @@
|
||||
"version": "3.0.0",
|
||||
"description": "",
|
||||
"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": {
|
||||
"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": {
|
||||
"type": "git",
|
||||
|
||||
@@ -6,6 +6,16 @@ import commonjs from "rollup-plugin-commonjs";
|
||||
import screeps from "rollup-plugin-screeps";
|
||||
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 {
|
||||
input: "src/main.ts",
|
||||
output: {
|
||||
@@ -20,6 +30,6 @@ export default {
|
||||
resolve(),
|
||||
commonjs(),
|
||||
typescript({tsconfig: "./tsconfig.json"}),
|
||||
screeps({configFile: "./screeps.json"})
|
||||
screeps({config: cfg, dryRun: cfg == null})
|
||||
]
|
||||
}
|
||||
|
||||
@@ -1,9 +1,29 @@
|
||||
{
|
||||
"main": {
|
||||
"email": "you@provider.tld",
|
||||
"password": "Password",
|
||||
"protocol": "https",
|
||||
"hostname": "screeps.com",
|
||||
"port": 443,
|
||||
"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"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user