question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Wishlist: recursive watching for a file pattern

See original GitHub issue

I want to run a command whenever a filename matching a particular glob pattern (*.rst) changes in a directory tree.

I can watch the directory tree recursively with server.watch('directory/'), but this triggers for other kinds of files as well.

I can watch for a glob pattern (*.rst), but this doesn’t support recursive globbing (yet).

Possible solutions:

  • implement '**/*.rst'-style globbing (perhaps backport the feature from Python 3.5?)
  • add a filter argument so I could say server.watch('.', filter=lambda fn: fn.endswith('.rst'), func='make html')

Note that a solution to manually use an external library for file globbing, like the one suggested in the manual, is unsuitable because it would not pick up newly-created files or subdirectories.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

github_iconTop Results From Across the Web

Recursive patterned File Globbing - CodeProject
Class and application to recursively or non-recursively match files or directories based on a wildcard pattern.
Read more >
Recursively looking for a list of file types - Stack Overflow
I want to use bash to remove all the files in a directory that aren't in an associative array of ...
Read more >
watchr - npm
Watchr provides a normalised API the file watching APIs of different node versions, nested/recursive file and directory watching, and accurate detailed ...
Read more >
Solved: recursive file list pattern - NI Community
Solved: Hello, I have created a subvi that searches through a main folder for specific files and adds them to a compressed folder....
Read more >
Untitled
Zstdgrep recursive. They must be defined somewhere at system level and not just at user level. In Linux, system-wide configuration files are located...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found