aboutsummaryrefslogtreecommitdiff
path: root/ciigo.go
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2021-10-17 19:14:20 +0700
committerShulhan <ms@kilabit.info>2021-10-17 19:14:20 +0700
commit36d729c71dd03303a2eef4cfefa64ac1a78a0ec1 (patch)
tree451649d9eaecd20b466a4a4d56a393410fbf8713 /ciigo.go
parent56488e32c04c4561d06d3446b81bb726d5cbb6ff (diff)
downloadciigo-36d729c71dd03303a2eef4cfefa64ac1a78a0ec1.tar.xz
all: fix empty fileMarkups on watcher
Previously, when user call ciigo.Watch(), and the markup file changes, the onChangeFileMarkup method will print an error "xyz not found" which cause the markup file not converted. This is caused by watcher.fileMarkups is empty. This changes fix this issue by initializing the fileMarkups field using listFileMarkups, so the next callback to onChangeFileMarkup can detect the changed file and convert it.
Diffstat (limited to 'ciigo.go')
-rw-r--r--ciigo.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/ciigo.go b/ciigo.go
index a5d4e84..d25d1c7 100644
--- a/ciigo.go
+++ b/ciigo.go
@@ -197,7 +197,7 @@ func Watch(opts *ConvertOptions) (err error) {
return fmt.Errorf("%s: %w", logp, err)
}
- w, err = newWatcher(htmlg, opts.Root, opts.Exclude)
+ w, err = newWatcher(htmlg, opts)
if err != nil {
return fmt.Errorf("%s: %w", logp, err)
}