mirror of
https://github.com/wassname/talk.git
synced 2026-07-03 03:46:48 +08:00
805492931b
Merge branch 'next' into timestamp Fix test and translations Merge branch 'timestamp' of github.com:coralproject/talk into timestamp * 'timestamp' of github.com:coralproject/talk: Fix test and translations Implement Timestamp
28 lines
623 B
TypeScript
28 lines
623 B
TypeScript
#!/usr/bin/env ts-node
|
|
|
|
import program from "commander";
|
|
import path from "path";
|
|
import watch from "../";
|
|
|
|
function list(val: string) {
|
|
return val.split(",");
|
|
}
|
|
|
|
program
|
|
.version("0.1.0")
|
|
.usage("<configFile>")
|
|
.option("-o, --only <watcher>", "only run the specified watcher", list)
|
|
.arguments("<configFile>")
|
|
.description("Run watchers defined in <configFile>")
|
|
.action((configFile, cmd) => {
|
|
const { only = [] } = cmd;
|
|
|
|
let config: any = require(path.resolve(configFile));
|
|
if (config.__esModule) {
|
|
config = config.default;
|
|
}
|
|
|
|
watch(config, { only });
|
|
})
|
|
.parse(process.argv);
|