File watcher to clear a folders content..

I have made a .bat script which is clearing a directory. This is the cache folder of my project. Temporary stored on my desktop and want to execute it. What I want is that it clears my cache directory when I save any .tpl file (templates). So I added a File Watcher on Smarty files (it isn't smarty, but it's the same extension) and used this settings:

Program: C:\Users\Bert\Desktop\CacheClear.bat
Arguments: L:\LocalMountedDrive\to\project\cache\folder

And the rest is all empty. Also unchecked "Immediate file sync" box and set show console to "Always" (for now)

When I save a .tpl file, the Run Output says; I have an incorrect command.

C:/Users/Bert/Desktop/ClearCache.bat L:/path/to/my/cache
The syntax of the command is incorrect.

When I run the .bat with the folder-path from the cmd tool it works perfect.

I probably do something wrong, does anyone know what? :-)
Many thanks in advance.

2 comments

I now have it working with another solution.
Created a batch script file inside my projects cache folder and let it execute without arguments as FileWatcher.

Also, it was important to set the working directory to the cache folder too. Otherwise it wasn't working either.

0

Hi there,

When I save a .tpl file, the Run Output says; I have an incorrect command.

Yes, not every DOS command accepts path with Linux style path separator (/ instead of \) which FileWatcher plugin uses (as most tools intended to be use here do work with Linux style just fine .. or even do not accept Windows paths at all).

Created a batch script file inside my projects cache folder and let it execute without arguments as FileWatcher.

Also, it was important to set the working directory to the cache folder too. Otherwise it wasn't working either.

I'm doing pretty much the same. I just still passing one argument -- file name -- but file name ONLY (no path part at all).

Feel free to file new ticket about this to the Issue Tracker (but please check for existing tickets first)

0

Please sign in to leave a comment.