File tree 3 files changed +22
-0
lines changed
3 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,8 @@ exclude_file = []
24
24
exclude_regex = []
25
25
# Exclude unchanged files.
26
26
exclude_unchanged = true
27
+ # Follow symlink for directories
28
+ follow_symlink = true
27
29
# This log file places in your tmp_dir.
28
30
log = " air.log"
29
31
# It's not necessary to trigger build each time file changes if it's too frequent.
Original file line number Diff line number Diff line change @@ -39,6 +39,7 @@ type cfgBuild struct {
39
39
ExcludeFile []string `toml:"exclude_file"`
40
40
ExcludeRegex []string `toml:"exclude_regex"`
41
41
ExcludeUnchanged bool `toml:"exclude_unchanged"`
42
+ FollowSymlink bool `toml:"follow_symlink"`
42
43
Delay int `toml:"delay"`
43
44
StopOnError bool `toml:"stop_on_error"`
44
45
SendInterrupt bool `toml:"send_interrupt"`
Original file line number Diff line number Diff line change @@ -143,6 +143,25 @@ func (e *Engine) cacheFileChecksums(root string) error {
143
143
e .watcherDebug ("!exclude checksum %s" , e .config .rel (path ))
144
144
return filepath .SkipDir
145
145
}
146
+
147
+ // Follow symbolic link
148
+ if e .config .Build .FollowSymlink && (info .Mode ()& os .ModeSymlink ) > 0 {
149
+ link , err := filepath .EvalSymlinks (path )
150
+ if err != nil {
151
+ return err
152
+ }
153
+ linkInfo , err := os .Stat (link )
154
+ if err != nil {
155
+ return err
156
+ }
157
+ if linkInfo .IsDir () {
158
+ err = e .watchDir (link )
159
+ if err != nil {
160
+ return err
161
+ }
162
+ }
163
+ return nil
164
+ }
146
165
}
147
166
148
167
if e .isExcludeFile (path ) || ! e .isIncludeExt (path ) {
You can’t perform that action at this time.
0 commit comments