You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Fix --js code running for a file with no match #859
--js code that runs once per file runs at the start of each file, before the search, also when the file has no match. Its value is then not used.
> rexreplace foo 'console.error("ran for " + name); "x"' a.txt b.txt --js -S # only a.txt has foo
ran for b
ran for a
So code with a side effect, like printing or writing a file, runs for files it does not change, and an error in the code is told for the first file, also when it has no match.
Change
The code runs at the first match of the file. A file with no match does not run it.
Good to know
Found in the review of 26 October. It changes what code with a side effect does, so it goes in the release note of v8.
Activity
Run --js code on first match per file to close #859 (#860)