tswatch/ts/tswatch.cli.ts

25 lines
604 B
TypeScript
Raw Normal View History

2018-10-28 00:48:43 +00:00
import * as plugins from './tswatch.plugins';
import * as paths from './tswatch.paths';
import { TsWatch } from './tswatch.classes.tswatch';
const tswatchCli = new plugins.smartcli.Smartcli();
tswatchCli.addCommand('test').subscribe(argvArg => {
const tsWatch = new TsWatch({
filePathToWatch: paths.cwd,
2018-10-28 18:28:08 +00:00
commandToExecute: 'npm run test2',
timeout: (() => {
if (argvArg.timeout) {
console.log(`timeing out after ${argvArg.timeout}`);
return argvArg.timeout;
} else {
return null;
}
})()
2018-10-28 00:48:43 +00:00
});
tsWatch.start();
});
tswatchCli.startParse();