5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-02 10:21:20 +08:00

filter the base directory from ignoreDirs (#2869)

* filter the base directory from ignoreDirs

* added PR 2869

---------

Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
This commit is contained in:
David Haukeness 2023-09-25 03:50:17 -06:00 committed by GitHub
parent 6d1489bf8e
commit ab0b0f8a7f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

View File

@ -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)
}
}
}

View File

@ -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)