Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

processDirectories() fails to return any directories if .gitignore contains directory/project/binary name #2867

Closed
haukened opened this issue Aug 28, 2023 · 4 comments · Fixed by #2869
Assignees
Labels
Bug Something isn't working

Comments

@haukened
Copy link
Contributor

Description

If you are building on linux with Go, go will produce a binary of the same name as the project top level directory.
Adding the name of this binary to the .gitignore file will cause processDirectories() to treat this as a wild card under the top level folder, effectively ignoring filesystem change notifications for the entire project.

To Reproduce

(assumes project named foo under /home/you/foo)

  1. Create wails project cd && wails init -n foo -t <whichever>
  2. add binary name foo to .gitignore
  3. run wails dev
  4. observe the stunning silence from *fsnotify.Watcher as you frantically edit every go file trying to figure out what is happening.

Expected behaviour

the processDirectories() function applies only to sub-directories of the top level folder, matching the behavior or git for which the .gitignore file is designed.

Screenshots

No response

Attempted Fixes

No response

System Details

Wails CLI v2.5.1

 SUCCESS  Done.                                                                                                                                             

# System

OS           | Arch Linux
Version      | Unknown   
ID           | arch      
Go Version   | go1.21.0  
Platform     | linux     
Architecture | amd64     

# Wails

Version         | v2.5.1
Package Manager | pacman

# Dependencies

Dependency | Package Name | Status    | Version    
*docker    | docker       | Installed | 1:24.0.5-1 
gcc        | gcc          | Installed | 13.2.1-3   
libgtk-3   | gtk3         | Installed | 1:3.24.38-1
libwebkit  | webkit2gtk   | Installed | 2.40.5-1   
npm        | npm          | Installed | 9.8.1-1    
pkg-config | pkgconf      | Installed | 1.8.1-1    
* - Optional Dependency

# Diagnosis

Your system is ready for Wails development!

Additional context

No response

@haukened haukened added the Bug Something isn't working label Aug 28, 2023
@haukened
Copy link
Contributor Author

@leaanthony you can assign this one back to me, i just wanted it to be documented. Will tackle tomorrow.

@leaanthony
Copy link
Member

There was a recent PR around .gitignore files...

@haukened
Copy link
Contributor Author

This was pretty simple to solve, just by grabbing the base level directory with filepath.Base(cwd) and then putting an if on the ignoreDirs append to filter the append of the base directory (and consequently the binary name).

@haukened
Copy link
Contributor Author

Resolved in PR #2869

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants