tswatch/ts/tswatch.cli.ts

47 lines
1.4 KiB
TypeScript
Raw Permalink Normal View History

2022-03-14 21:17:36 +01:00
import * as plugins from './tswatch.plugins.js';
import * as paths from './tswatch.paths.js';
import { logger } from './tswatch.logging.js';
2018-10-28 02:48:43 +02:00
2022-03-14 21:17:36 +01:00
import { TsWatch } from './tswatch.classes.tswatch.js';
2018-10-28 02:48:43 +02:00
const tswatchCli = new plugins.smartcli.Smartcli();
2019-05-08 11:14:57 +02:00
// standard behaviour will assume gitzone setup
2022-08-03 20:03:15 +02:00
tswatchCli.standardCommand().subscribe((argvArg => {
tswatchCli.triggerCommand('npm', {});
}))
2019-05-08 11:14:57 +02:00
2020-07-04 10:45:56 +00:00
tswatchCli.addCommand('element').subscribe(async (argvArg) => {
2019-10-12 15:07:44 +02:00
logger.log('info', `running watch task for a gitzone element project`);
const tsWatch = new TsWatch('element');
2019-10-12 15:07:44 +02:00
await tsWatch.start();
});
2020-07-04 10:45:56 +00:00
tswatchCli.addCommand('npm').subscribe(async (argvArg) => {
2019-10-14 14:53:55 +02:00
logger.log('info', `running watch task for a gitzone element project`);
const tsWatch = new TsWatch('node');
2019-10-14 14:53:55 +02:00
await tsWatch.start();
});
2020-07-04 10:45:56 +00:00
tswatchCli.addCommand('service').subscribe(async (argvArg) => {
2019-10-14 14:57:43 +02:00
logger.log('info', `running test task`);
const tsWatch = new TsWatch('service');
2019-10-14 14:57:43 +02:00
await tsWatch.start();
});
2020-07-04 10:45:56 +00:00
tswatchCli.addCommand('test').subscribe(async (argvArg) => {
2019-10-14 14:57:43 +02:00
logger.log('info', `running test task`);
const tsWatch = new TsWatch('test');
await tsWatch.start();
});
2020-07-04 10:45:56 +00:00
tswatchCli.addCommand('website').subscribe(async (argvArg) => {
2019-10-14 14:57:43 +02:00
logger.log('info', `running watch task for a gitzone website project`);
const tsWatch = new TsWatch('website');
2019-10-14 14:57:43 +02:00
await tsWatch.start();
});
2020-05-22 08:14:59 +00:00
export const runCli = async () => {
tswatchCli.startParse();
};