Skip to content

Commit

Permalink
Merge pull request #116 from marp-team/fix-up-watch
Browse files Browse the repository at this point in the history
Fix up not working watch mode
  • Loading branch information
yhatt authored Jun 28, 2019
2 parents 3da75c5 + 5d3578e commit 3f13d98
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

- Downgrade pkg to v4.3.x to fix segfault in the standalone build for Windows ([#111](https://github.com/marp-team/marp-cli/issues/111), [#112](https://github.com/marp-team/marp-cli/pull/112))
- Improve error handling while running server ([#115](https://github.com/marp-team/marp-cli/pull/115))
- Fix up not working watch mode ([#116](https://github.com/marp-team/marp-cli/pull/116))

## v0.11.0 - 2019-06-24

Expand Down
9 changes: 6 additions & 3 deletions src/marp-cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -313,11 +313,14 @@ export default async function(argv: string[] = []): Promise<number> {
if (!(e instanceof CLIError)) throw e

cli.error(e.message)

// Stop running notifier and watcher to exit process correctly
// (NOTE: Don't close in the finally block to keep watching)
notifier.stop()
if (watcherInstance) watcherInstance.chokidar.close()

return e.errorCode
} finally {
await Converter.closeBrowser()
notifier.stop()

if (watcherInstance) watcherInstance.chokidar.close()
}
}

0 comments on commit 3f13d98

Please sign in to comment.