Quantcast
Channel: JetBrains Developer Community : Thread List - IntelliJ IDEA Users
Viewing all articles
Browse latest Browse all 5661

Custom File Watchers - confused?

$
0
0

Hey there folks,

I'm trying to set up a custom file watcher and I'm not able to figure out why it doesn't seem to be working. I've scoured the web for hours and just can't find anything on it.

The gist of it is this:

I want to use a web settings file (.php) to generate SCSS files (literally .scss) which would then be output to CSS. Basically, the "transpiler", if you will, takes name/value pairs from the settings file, and dumps them in as formatted scss variables into the .scss file.

This gives me the ability to manage application directories from one spot. Love it.

 

I wrote a powershell script that handles the creation of the .scss file from the .php and it works wonderfully. However, I haven't exported it to an .exe file (actually not sure how to do that).

My approach was to set the watcher to watch .php file changes on the directory where my web settings file lives. From there, the "program" it calls is actually powershell.exe and passes it a -file "path\to\file\" argument. The script, if run, should handle everything else on it's own. I can get the powershell call to work in a cmd prompt, which leads me to believe that intellij isn't even making the call. Intellij is running in administrator mode.

 

Am I wrong in thinking that intellij actually watches the file for you? Because this thing just isn't working

 

To sum up, I want this:

.php file -> on update -> copy values to .scss file (file update)

 

That's all. Seems simple enough, but it doesn't appear to be firing (no error or anything). The PS script is totally self-contained and requires no input, so I know that's not an issue.

I'm putting my watcher settings below. I'm starting to think I don't even understand how the file watchign system works in intellij in which case I'll just write a cmd promt watcher and run it in the background boooo

 

Thanks for any help in advance!

 

=====Settings below======

 

Setting NameSetting Value
NameApp Constants to SCSS Updater
DescriptionTakes selected App constants from the header comment @SCSSEXPORT array in Utility_Constants.php and exports them to the appVars.scss file for SCSS usage.

 

OPTIONS:

 

Setting NameSetting Value
Output Filters[none]
Show ConsoleAlways
Immediate File SynchronizationYes
Check file for syntax errorsYes
Track root only filesUnavailable

 

WATCHER SETTINGS:

 

Setting NameSetting Value
File typePHP files (PHP files)
ScopeProject Files
ProgramC:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
Arguments-file "C:\PROGRA~1\wamp\www\arctic\localScript\sassUpdater.ps1"
Working DirectoryC:\Program Files\wamp\www\tanguer\include\class\Utility
Environment Variables[none set, none required]
Output Paths$ProjectFileDir$\css\sass\include\appVars.scss

A note on output paths: I also had it write directly to a file at one point as well with no results- at this point I'm trying the stdout version which is bringing me no luck.

I can only assume it's not even triggering since the log won't even come up like it will when the SCSS compiler runs.

Thanks!


Viewing all articles
Browse latest Browse all 5661

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>