air icon indicating copy to clipboard operation
air copied to clipboard

Include dir

Open spiffyjr opened this issue 5 years ago • 13 comments

Would it be possible to add include_dir which would be used instead of exclude_dir. We have a monolithic repository and it would be easiest to have it watch the root and only include directories the project needs. Thanks!

spiffyjr avatar Dec 20 '19 02:12 spiffyjr

OK, I’ll implement it:)

cosmtrek avatar Dec 20 '19 22:12 cosmtrek

Great, thanks!

spiffyjr avatar Dec 30 '19 18:12 spiffyjr

@spiffyjr Done, could you try the latest version?

cosmtrek avatar Jan 01 '20 12:01 cosmtrek

I tried it out but adding root = "../" seems to not watch anything and I was able to get include_dir to work with it.

spiffyjr avatar Jan 03 '20 16:01 spiffyjr

Suppose the repo's directory:

repo
|-- A
      |-- A1
      |-- A2
|-- B
      |-- B1
      |-- B2

If you want to watch A, the air config should like this:

root = "."
include_dir = ["A"]
...

and running air in the root directory of repo should work.

cosmtrek avatar Jan 04 '20 05:01 cosmtrek

Yeah, but if I want the root to be A1 (where I run air) and to watch A it doesn't seem to work?

root = "../../"
include_dir = ["A"]
...

spiffyjr avatar Jan 14 '20 14:01 spiffyjr

@spiffyjr seems wired and not work...

cosmtrek avatar Jan 14 '20 17:01 cosmtrek

I'm not sure what you mean @cosmtrek ?

spiffyjr avatar Jan 17 '20 15:01 spiffyjr

See https://github.com/cosmtrek/air/pull/43. This does what I need but I'm not sure it conflicts with anything else.

spiffyjr avatar Jan 17 '20 15:01 spiffyjr

#43 didn't quite do what I needed in all circumstances but #44 should do the trick.

spiffyjr avatar Jan 17 '20 15:01 spiffyjr

So is this working? I tried to watch submodule but it did not work.

SimonPrague avatar Mar 03 '21 14:03 SimonPrague

This was working when I submitted the pull request, but no longer merges with the latest master. I'd still like to see this added because the latest master no longer works with my monolithic project structure.

spiffyjr avatar Mar 17 '21 14:03 spiffyjr