diff --git a/.Trash-1000/files/8ba64226-9d16-4f28-a568-49c1ea3aa1e7 b/.Trash-1000/files/8ba64226-9d16-4f28-a568-49c1ea3aa1e7 deleted file mode 100644 index 94e12f7..0000000 --- a/.Trash-1000/files/8ba64226-9d16-4f28-a568-49c1ea3aa1e7 +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "esModuleInterop": true, - "lib": ["es2015"], - "target": "ES2017" - } -} \ No newline at end of file diff --git a/.Trash-1000/info/8ba64226-9d16-4f28-a568-49c1ea3aa1e7.trashinfo b/.Trash-1000/info/8ba64226-9d16-4f28-a568-49c1ea3aa1e7.trashinfo deleted file mode 100644 index 4f5c50a..0000000 --- a/.Trash-1000/info/8ba64226-9d16-4f28-a568-49c1ea3aa1e7.trashinfo +++ /dev/null @@ -1,3 +0,0 @@ -[Trash Info] -Path=/home/coder/project/tsconfig.json -DeletionDate=2019-05-08T21:54:46.502Z \ No newline at end of file diff --git a/ts/tswatch.classes.tswatch.ts b/ts/tswatch.classes.tswatch.ts index 0b844b6..ab8d08e 100644 --- a/ts/tswatch.classes.tswatch.ts +++ b/ts/tswatch.classes.tswatch.ts @@ -9,13 +9,13 @@ export class TsWatch { public watcherMap = new plugins.lik.Objectmap(); constructor(watchmodeArg: interfaces.TWatchModes) { - this.watchmode = watchmodeArg; + this.watchmode = watchmodeArg; } /** * starts the TsWatch instance */ - public async start () { + public async start() { switch (this.watchmode) { case 'test': const tsWatchInstanceTest = new Watcher({ @@ -34,21 +34,30 @@ export class TsWatch { this.watcherMap.add(tsWatchInstanceGitzoneNpm); break; case 'gitzone_website': - const tsWatchInstanceGitzoneWebsite = new Watcher({ - filePathToWatch: paths.cwd, - commandToExecute: 'npm run test', + // server directory + this.watcherMap.add( + new Watcher({ + filePathToWatch: plugins.path.join(paths.cwd, './ts/'), + commandToExecute: 'npm run start', + timeout: null + }) + ); + + // client directory + this.watcherMap.add(new Watcher({ + filePathToWatch: plugins.path.join(paths.cwd, './ts_web/'), + commandToExecute: 'npm run build', timeout: null - }); - this.watcherMap.add(tsWatchInstanceGitzoneWebsite); + })); break; case 'echoSomething': - const tsWatchInstanceEchoSomething = new Watcher({ - filePathToWatch: paths.cwd, - commandToExecute: 'npm -v', - timeout: null - }); - this.watcherMap.add(tsWatchInstanceEchoSomething); - break; + const tsWatchInstanceEchoSomething = new Watcher({ + filePathToWatch: paths.cwd, + commandToExecute: 'npm -v', + timeout: null + }); + this.watcherMap.add(tsWatchInstanceEchoSomething); + break; default: break; } @@ -60,9 +69,9 @@ export class TsWatch { /** * stops the execution of any active Watchers */ - public async stop () { + public async stop() { this.watcherMap.forEach(async watcher => { await watcher.stop(); - }) + }); } } diff --git a/ts/tswatch.cli.ts b/ts/tswatch.cli.ts index f815430..4711049 100644 --- a/ts/tswatch.cli.ts +++ b/ts/tswatch.cli.ts @@ -14,4 +14,10 @@ tswatchCli.addCommand('test').subscribe(async argvArg => { await tsWatch.start(); }); +tswatchCli.addCommand('website').subscribe(async argvArg => { + logger.log('info', `running watch task for a gitzone website project`); + const tsWatch = new TsWatch('gitzone_website'); + await tsWatch.start(); +}) + tswatchCli.startParse();