node-supervisor icon indicating copy to clipboard operation
node-supervisor copied to clipboard

wishlist: also act on newly created files

Open adiknoth opened this issue 12 years ago • 5 comments
trafficstars

Hi!

In addition to watch changes to existing files, it would be handy if supervisor could also monitor the appearance of new files.

Maybe a command line flag that turns on this feature would be useful.

adiknoth avatar Feb 07 '13 11:02 adiknoth

I would love to include this feature. As long as it worked well and only caught files that fit the given criteria, I think it would be fine to do this for everyone. No need tor a flag IMO.

On Thu, Feb 7, 2013 at 3:25 AM, Adrian Knoth [email protected]:

Hi!

In addition to watch changes to existing files, it would be handy if supervisor could also monitor the appearance of new files.

Maybe a command line flag that turns on this feature would be useful.

— Reply to this email directly or view it on GitHubhttps://github.com/isaacs/node-supervisor/issues/89.

iangreenleaf avatar Feb 07 '13 21:02 iangreenleaf

+1

givan avatar Nov 30 '13 20:11 givan

+1 Indeed. It actually took me a while to realize what was going on when restarts weren't happening as I'd expect. During certain phases of development, one is creating and/or removing files nearly as often as one is modifying them.

I wouldn't expect it to be much work to rescan directories that have been passed via --watch.

itegebo avatar Feb 02 '14 01:02 itegebo

I created a branch to experiment with this feature. It will now rescan the watched items, but will not restart if only a new file is placed in one of the watched directories.

Unfortunately, I think a good deal more refactoring is needed to include new files without requiring a restart/rescan. In particular, watching needs to be sensitive to whether a file or directory was requested. If it's a directory, it needs to be watched itself and scan/update on changes. Even more unfortunately, I think you need to keep track of what may no longer be watched and what's still around.

Fortunately, I tend to modify existing files when a new file is added. Thus, the new stuff gets added.

itegebo avatar Feb 02 '14 03:02 itegebo

+1

everthis avatar May 28 '17 05:05 everthis