air-verse / air

☁️ Live reload for Go apps
GNU General Public License v3.0
16.38k stars 772 forks source link

Support for watching `.hidden` directories #497

Open atifcppprogrammer opened 8 months ago

atifcppprogrammer commented 8 months ago

My use case requires watching files that reside in a hidden director, in particular the cmd/goserve-proto/.dist directory, in the following file structure.

.
├── .air.toml
├── cmd
│   └── goserve-proto
│       ├── .dist
│       │   ├── -
│       │   │   └── __static__
│       │   │       ├── DirectoryListing-387e1df3.css
│       │   │       ├── DirectoryListing-c9eed495.js
│       │   │       ├── DirectoryListing-c9eed495.js.map
│       │   │       ├── global-styles-06e23662.js
│       │   │       ├── global-styles-06e23662.js.map
│       │   │       ├── UserLogin-27a77ecb.css
│       │   │       ├── UserLogin-3d8b1e36.js
│       │   │       └── UserLogin-3d8b1e36.js.map
│       │   ├── DirectoryListing.html
│       │   └── UserLogin.html
│       └── main.go

However even explicitly adding .cmd/goserve-proto/.dist in the include_dir field for the .air.toml config file seems to ignore this directory from being watched as is evident from the following screenshot. Screenshot from 2023-11-09 01-59-28

The following are the contents of the [build] section of my .air.toml file for reference and I am using Linux Ubuntu 22.04 as my operating system, please let me know if further details are required from my side to resolve this issue. btw air is a fantastic tool :heart: , please keep up the great work. :+1:

[build]
  bin            = "tmp/main"
  cmd            = "go build -C ./cmd/goserve-proto -o ../../tmp/main"
  delay          = 1000
  exclude_dir    = ["tmp", "testdata", "web/node_modules"]
  exclude_regex  = ["_test.go"]
  include_dir    = ["cmd/goserve-proto", "cmd/goserve-proto/.dist", "internal"]
  include_ext    = ["go", "js", "css", "html"]
  log            = "build-errors.log"