diff --git a/cmd/tools/vwatch.v b/cmd/tools/vwatch.v index 8827101294..e6f78b4e23 100644 --- a/cmd/tools/vwatch.v +++ b/cmd/tools/vwatch.v @@ -77,6 +77,7 @@ mut: scan_cycles int // how many times the worker has scanned for source file changes clear_terminal bool // whether to clear the terminal before each re-run add_files []string // path to additional files that have to be watched for changes + ignore_exts []string // extensions of files that will be ignored, even if they change (useful for sqlite.db files for example) } [if debug_vwatch] @@ -120,6 +121,9 @@ fn (mut context Context) get_stats_for_affected_vfiles() []VFileStat { if pf_ext in ['', '.bak', '.exe', '.dll', '.so', '.def'] { continue } + if pf_ext in context.ignore_exts { + continue + } if pf.starts_with('.#') { continue } @@ -258,6 +262,7 @@ fn main() { context.is_worker = os.args.contains('-vwatchworker') context.clear_terminal = os.getenv('VWATCH_CLEAR_TERMINAL') != '' context.add_files = os.getenv('VWATCH_ADD_FILES').split(',') + context.ignore_exts = os.getenv('VWATCH_IGNORE_EXTENSIONS').split(',') context.opts = os.args[1..].filter(it != '-vwatchworker') context.elog('>>> context.pid: $context.pid') context.elog('>>> context.vexe: $context.vexe')