Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
84bdc73900 | |||
71bfa980df |
33
linker.go
33
linker.go
@ -48,9 +48,36 @@ func link(from, to string) chan struct{} {
|
|||||||
w.FilterOps(watcher.Write, watcher.Rename, watcher.Move, watcher.Create, watcher.Remove)
|
w.FilterOps(watcher.Write, watcher.Rename, watcher.Move, watcher.Create, watcher.Remove)
|
||||||
w.IgnoreHiddenFiles(true)
|
w.IgnoreHiddenFiles(true)
|
||||||
|
|
||||||
if err := w.AddRecursive(from); err != nil {
|
// Instead of watching the entire directory tree, only watch the package directories
|
||||||
fmt.Println(err.Error())
|
// that we need to monitor
|
||||||
os.Exit(1)
|
for _, packagePath := range packages {
|
||||||
|
err := filepath.Walk(packagePath, func(path string, info os.FileInfo, err error) error {
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
// Skip excluded directories completely
|
||||||
|
if info.IsDir() && isExcludedPath(path, "node_modules", ".git") {
|
||||||
|
return filepath.SkipDir
|
||||||
|
}
|
||||||
|
|
||||||
|
// Only add directories and relevant files that aren't in excluded paths
|
||||||
|
if !isExcludedPath(path, "node_modules", ".git") {
|
||||||
|
if info.IsDir() {
|
||||||
|
return w.Add(path)
|
||||||
|
}
|
||||||
|
// Only watch JavaScript and TypeScript files
|
||||||
|
if isIncludedExt(info.Name(), "*.js", "*.ts") {
|
||||||
|
return w.Add(path)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
})
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
fmt.Printf("Error setting up watcher for %s: %v\n", packagePath, err)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
go func() {
|
go func() {
|
||||||
|
2
main.go
2
main.go
@ -26,7 +26,7 @@ func main() {
|
|||||||
app := &cli.App{
|
app := &cli.App{
|
||||||
Name: "gowebbuild",
|
Name: "gowebbuild",
|
||||||
Usage: "All in one tool to build web frontend projects.",
|
Usage: "All in one tool to build web frontend projects.",
|
||||||
Version: "7.1.1",
|
Version: "7.2.0",
|
||||||
Authors: []*cli.Author{{
|
Authors: []*cli.Author{{
|
||||||
Name: "trading-peter (https://github.com/trading-peter)",
|
Name: "trading-peter (https://github.com/trading-peter)",
|
||||||
}},
|
}},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user