0

I have files in the following folder structure:

enter image description here

Can I setup Nodemon to restart when .primary is moved to another folder (typically a sibling folder, at same level)?

Example:

  • Move .primary:
    • fromapp/en_160x600_PROG_RESID_Children
    • to app/en_160x600_PROG_TOUR_Baby.

I've tried multiple variations & attempts with this command, but so far nothing detects the file relocation:

nodemon --watch app/**/.primary --exec "brunch watch --server"
chamberlainpi
  • 4,854
  • 8
  • 32
  • 63

1 Answers1

1

Nevermind, just figured it out.

Nodemon watches filenames with the specified extension (note the strong emphasis on EXTENSION).

While the file I was watching does end with a primary extension, it actually MUST have a filename before the period. It cannot simply end with a .nameOfYourExtension.

My guess is that internally it must check for {your-watch-path}/*{your-extension}, which in my case was: app/*.primary, so no wonder I had issues!

After changing my setup to use focus.primary, nodemon picks up the file relocation correctly.

enter image description here

chamberlainpi
  • 4,854
  • 8
  • 32
  • 63