diff --git a/v2/cmd/wails/internal/dev/watcher.go b/v2/cmd/wails/internal/dev/watcher.go index 1406f0c1e..499b76dfd 100644 --- a/v2/cmd/wails/internal/dev/watcher.go +++ b/v2/cmd/wails/internal/dev/watcher.go @@ -44,14 +44,16 @@ func initialiseWatcher(cwd string) (*fsnotify.Watcher, error) { func getIgnoreDirs(cwd string) []string { ignoreDirs := []string{filepath.Join(cwd, "build/*"), ".*", "node_modules"} - + baseDir := filepath.Base(cwd) // Read .gitignore into ignoreDirs f, err := os.Open(filepath.Join(cwd, ".gitignore")) if err == nil { scanner := bufio.NewScanner(f) for scanner.Scan() { line := scanner.Text() - ignoreDirs = append(ignoreDirs, line) + if line != baseDir { + ignoreDirs = append(ignoreDirs, line) + } } } diff --git a/website/src/pages/changelog.mdx b/website/src/pages/changelog.mdx index cd7e0e69e..521899726 100644 --- a/website/src/pages/changelog.mdx +++ b/website/src/pages/changelog.mdx @@ -43,6 +43,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Fixed `SetBackgroundColour` so it sets the window's background color to reduce resize flickering on Linux. Added by @lyimmi in [PR](https://github.com/wailsapp/wails/pull/2853) - Fixed disable window resize option and wrong initial window size when its enabled. Added by @lyimmi in [PR](https://github.com/wailsapp/wails/pull/2863) - Fixed build hook command parsing. Added by @smac89 in [PR](https://github.com/wailsapp/wails/pull/2836) +- Fixed filesystem watcher from filtering top level project directory if binary name is included in .gitignore. Added by [@haukened](https://github.com/haukened) in [PR #2869](https://github.com/wailsapp/wails/pull/2869) - Fixed `-reloaddir` flag to watch additional directories (non-recursively). [@haukened](https://github.com/haukened) in [PR #2871](https://github.com/wailsapp/wails/pull/2871) - Fixed support for Go 1.21 `go.mod` files. Fixed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2876)