Search code examples
macosplistcompass-sasssass

Compile scss file with compass when it changes


I'm trying to compile a scss file as soon as it changes.

I installed compass:

gem install compass

I created a plist file, ~/Library/LaunchAgents/compile_scss.plist:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>Label</key>
    <string>Compass</string>
    <key>ProgramArguments</key>
    <array>
        <string>compass</string>
        <string>compile</string>
        <string>/Users/name/localhost/compass/lala.scss</string>
    </array>
    <key>WatchPaths</key>
    <array>
        <string>/Users/name/localhost/compass/lala.scss</string>
    </array>
</dict>
</plist>

I loaded it:

launchctl load ~/Library/LaunchAgents/compile_scss.plist

And then, I changed the lala.scss file.

Problem: a lala.css file is not created...

Any idea why?


Solution

  • Run this command: compass watch /directory/with/your/site to start monitoring for changes.