fix(core): update

This commit is contained in:
2021-11-29 20:26:59 +01:00
parent 55746f5d92
commit 9628e914b5
12 changed files with 26628 additions and 842 deletions

View File

@ -83,17 +83,16 @@ export class Smartchok {
/**
* stop the watcher process if watching
*/
public stop() {
const closeWatcher = () => {
this.watcher.close();
public async stop() {
const closeWatcher = async () => {
await this.watcher.close();
};
if (this.status === 'watching') {
console.log('closing while watching');
closeWatcher();
await closeWatcher();
} else if (this.status === 'starting') {
this.watchingDeferred.promise.then(() => {
closeWatcher();
});
await this.watchingDeferred.promise;
await closeWatcher();
}
}
}