mapcomplete/scripts/Script.ts

25 lines
550 B
TypeScript
Raw Normal View History

2023-01-09 20:30:13 +01:00
import ScriptUtils from "./ScriptUtils"
export default abstract class Script {
private readonly _docs: string
constructor(docs: string) {
this._docs = docs
}
abstract main(args: string[]): Promise<void>
public run(): void {
ScriptUtils.fixUtils()
const args = [...process.argv]
args.splice(0, 2)
this.main(args)
.then((_) => console.log("All done"))
.catch((e) => console.log("ERROR:", e))
2023-01-09 20:30:13 +01:00
}
2023-06-11 19:04:40 +02:00
public printHelp() {
2023-06-11 19:04:40 +02:00
console.log(this._docs)
}
2023-01-09 20:30:13 +01:00
}