I'm going through all JS files recursively and minifying them. However I have to leave some JS files intact.
I've had a lot of success using a combination of for, dir and findstr. But when I wanted to ignore already minified files (files ending with "-min.js") the FINDSTR command broke.
This is the command I've used:
for /f %i in ('dir /b /a-d /s "D:\update" ^| findstr /liv "\admin" ^| findstr /ile ".js" ^| findstr /vile "-min.js" ^| findstr /vile ".min.js"') do echo %i
With the following errors:
FINDSTR: /. ignored
FINDSTR: /j ignored
FINDSTR: Bad command line
FINDSTR: Write error
FINDSTR: Write error
FINDSTR: Write error
FINDSTR: Write error
The problem is surely with the findstr /vile "-min.js" clause however I don't know why hyphen is causing a problem since I'm using the /l (literal) flag.