How to trigger file watcher on a entire directory in Webstorm - intellij-idea

I'm using Webstorm file watcher to compile my CoffeeScript.
My problem is that I have refactored the strutcure of my project's files.
Can I remove all files in /bin directory and tell to webstorm to apply his file watcher compile command on all .coffee files in a directory ? Because I don't want to open, modify and redo modification each file only for getting the compiled javascrit...

Yes, you can use 'Run file watchers' command to trigger a watcher for selected folder/project: just select a folder/project root, hit Ctrl+Shift+A -> type "run file " -> choose Run File Watchers.... You can assign custom shortcut for "Plugins | File Watchers | Run File Watchers" action in Settings | Keymap to make this procedure less complicated.

Related

Intellij Project View does not show log files

Somehow IntelliJ IDEA 2020.1.1 does not show *.log files as you can see in the picture. I tried to delete .idea folder and uninstall .ignore plugin but didn't help.
How to see *.log files in Project View in Intellij ?
Make sure the file type mapping is correct and *.log extension is associated with the Text file type in File | Settings | Editor | File Types:

Force IntelliJ to use another Home Directory?

I have read this... it does not answer the question.
I would like to have IntelliJ use another location for all of my project files. Currently, it goes to c:\users\ as a default project location.
I want to change that to c:\git.
I tried to change the "Start in" link properties, to no avail.
I don't want to force all of the configuration (ie: the .IdeaIC15 folder) to be relocated, I just want it to go to c:\git when I click "Open project".
To change the directory where project files are located to C:\git:
Select Help->Edit Custom VM Options...
Add the following line to the end of the file that comes up in the editor (*):
-Duser.home=C:\git
Restart IntelliJ.
(*) The file that comes up in the editor will either be idea64.exe.vmoptions or idea.exe.vmoptions.
Notes:
This will update/create a .vmoptions file in your config directory. It does not modify the vmoptions file in your install directory.
The above steps do not change the default directory that is used
when cloning git repositories. This is the directory that is used in
the File->New->Project from Version Control->Git window. You
still need to set that directory to C:\git and clone one remote repo
into C:\git. Once you have done that IntelliJ remembers the directory and
uses it for subsequent clones.
https://intellij-support.jetbrains.com/hc/en-us/articles/207240985-Changing-IDE-default-directories-used-for-config-plugins-and-caches-storage
Locations can be changed by editing the following file:
IDE_HOME\bin\idea.properties
Follow the comments in idea.properties file to change the defaults, make sure to un-comment the lines defining these properties:
idea.config.path
idea.system.path
idea.plugins.path
idea.log.path

LESSC to compile to a custom path using environment variable

Bottom line I need lessc to compile my main.less file to $CATALINA_EC_TMP/main.css
I'm working on this project, where I need to generate multiple output css files originating from the same source (LESS file) using LESSC.
So with Jet Brain's (WebStorm or IntelliJ Idea) File Watcher, I don't get much of options to save the output files to a custom path using an environment variable.
The reason why I use an environment variable is because some of the outputted files is in a temporary path (it changes whenever I deploy with ant)
That said ...
This is my Environment Variable:
$CATALINA_EC_TMP = '/foo/bar/'
and it's changing so in the next deployment, it won't be /foo/bar/ anymore.
and this is the command line that's being executed by my IDE to compile less files
/usr/local/bin/lessc --no-color main.less
I need lessc to compile my main.less file to $CATALINA_EC_TMP/main.css
so the resulting file would be in that case /foo/bar/main.css or wherever the $CATALINA_EC_TMP value is.
I hope that there's a solution to this, anyway if it doesn't exist I think I'll use fswatcher to copy my generated css files into my destinations whenever I compile.

Force file sync after file watcher runs

I have a stylus file watcher that runs a custom script when a stylus file changes. I'd like to have webstorm/idea re-sync all stylus files after the command completes, but the "output paths to refresh" seems inadequate to the task. That is, it's looking for me to specify a path/file when possibly all stylus files have been updated.
Is there a syntax or option that would cause webstorm to update all files or all files with a specific extension after running a file watcher? If not, any other suggestions for triggering a re-sync (not manually) after executing a file watcher?
EDIT: WebStorm v9.0.3

yuicompressor and/or uglify-js does not work in PhpStorm

I have installed node package manager (npm) on my windows machine and then i ran the command "npm install less -g" and went on setting up the file watcher in PhpStorm for LESS. This worked very good. I also managed to get it to put the .css files in the css folder instead of in the less folder where I have my .less files.
My next step was to install yuicompressor so I ran the command "npm install yuicompressor -g". And then I set it up in PhpStorm by adding the yuicompressor for CSS, but it only creates empty .min.css files.
In the PhpStorm watcher settings I have set:
Program: "C:\Users\XXX\AppData\Roaming\npm\yuicompressor.cmd"
And ticked the box "Create output file from stdout"
I want to achieve this:
.less (project_root/less) -> .css (project_root/css) -> .min.css (project_root/css)
Is there any one else that has had the same problem, I can't seem to find any solution.
Btw, I also tried to install uglify-js, but with the same result, it only creates empy .min.js files.
Some extra info, my environment variables are as follows:
PATH (User) = C:\Users\XXX\AppData\Roaming\npm
Path (System) = C:\Program Files\nodejs\
I removed the "Create output file from stdout" (from the yui CSS file watcher and left it checked on the LESS file watcher) and it seemed to work. But I had to link to the yuicompressor.cmd and not the .jar file as mentioned in the links from LazyOne. I also had to uncheck the "Immediate file synchronization" on the LESS file watcher but needed it to be checked on the yui CSS file watcher.
Seems like its very tricky to get it to go from "LESS -> CSS -> CSS compressed" with only saving the .less file when editing, but with this setup it finally worked.