mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-02 20:03:01 +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:
parent
6d1489bf8e
commit
ab0b0f8a7f
@ -44,16 +44,18 @@ 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()
|
||||
if line != baseDir {
|
||||
ignoreDirs = append(ignoreDirs, line)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return lo.Uniq(ignoreDirs)
|
||||
}
|
||||
|
@ -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)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user