fix(core): update
This commit is contained in:
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user