Adding extension to file via filewatcher in WebStorm 9

136 views Asked by At

I frequently have to send JS files through Outlook, which means that I have to modify the extension of the file to txt or the like so the recipient can receive it. I'd ideally like to implement a file watcher in WebStorm to simply output a child file with .txt appended to it similar to how it'll show a child CSS file for a LESS file.

To sum up, given a file named "file.js", I would like it to output a "file.js.txt" as well whenever I make a change.

Is there any simple way to go about doing this?

1

There are 1 answers

0
lena On

You can create a .bat file (shell script) that would copy files and then configure it as a file watcher. Like:

copy %1 %2 /Y

Watcher settings:

Program: path/to/your/batfile.bat
Arguments: $FileName$ $FileName$.txt
Working directory: $FileDir$
Output paths: $FileName$.txt