New command structure. Add replace command.

This commit is contained in:
2022-09-28 10:10:01 +02:00
parent bea89e2a80
commit 8433170681
6 changed files with 233 additions and 152 deletions

View File

@ -32,10 +32,15 @@ func link(from, to string) chan struct{} {
name := gjson.Get(content, "name").String()
if deps[name] {
packages[name] = filepath.Dir(packageFiles[i])
pp, err := filepath.Abs(filepath.Dir(packageFiles[i]))
if err == nil {
packages[name] = pp
}
}
}
fmt.Printf("Found %d npm packages to monitor for changes.\n", len(packages))
go func() {
w := watcher.New()
w.SetMaxEvents(1)