Cactusbone
Cactusbone

Reputation: 1076

Intellij external tool does not output stdout logs from Sass

i'm using sass for my project, in intellij using sass plugin.

i want to be able to launch sass --watch from within intellij, to be able to get console feedback, with clickable lines.

i've setup an external tool in intellij with:

it does compile my scss to css without problems but the stdout from sass are not reported in the intellij console. i only get stderr. if i have an error, after a while, i get a bunch of lines at once.

so i'm guessing there is some kind of buffering happening. redirecting 1>&2 does not solve the problem.

Here's what i get in logs

Sass::Compiler#on_updating_stylesheet callback is deprecated and will be removed in a future release. Use Sass::Compiler#on_updated_stylesheet instead, which is run after stylesheet compilation. 
d:/ruby/lib/ruby/gems/1.9.1/gems/sass-3.1.11/vendor/fssm/lib/fssm/support.rb:40: Use RbConfig instead of obsolete and deprecated Config.

and here's what i get using the same command in a console :

Sass::Compiler#on_updating_stylesheet callback is deprecated and will be removed in a future release. Use Sass::Compiler#on_updated_stylesheet instead, which is
 run after stylesheet compilation.
>>> Sass is watching for changes. Press Ctrl-C to stop.
      error src/main/www/css/test.scss (Line 3690: Invalid CSS after "...');  IE6 & IE7*": expected "{", was "/")
      error src/main/www/css/test.scss (Line 80: Invalid CSS after "...unimplemented *": expected "{", was "/")
d:/ruby/lib/ruby/gems/1.9.1/gems/sass-3.1.11/vendor/fssm/lib/fssm/support.rb:40: Use RbConfig instead of obsolete and deprecated Config.

(yes i have an intended error in my scss file to produce logs)

Upvotes: 0

Views: 751

Answers (1)

Cactusbone
Cactusbone

Reputation: 1076

found it thanks to default ruby arguments in intellij ruby projects

you need to pass ruby the following options :

-e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift)

and that did the trick

  • Program : D:\ruby\bin\ruby.exe
  • Parameters : -e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) d:/ruby/bin/sass -g --watch $/FileRelativeDir$
  • Working directory : $ProjectFileDir$

Upvotes: 3

Related Questions