Trying to compile SASS to a different directory


#1

Im just trying to change the file directory where cloud9 compiles my sass files. I’d like to keep my scss files in one folder and compile them into corresponding css files in a css folder. Cant figure out how to do that, sass commands give me an error so I cant use sass --watch scss:css


#2

I have C9 set up to compile my pages with compass rather than the built-in compiler – lots more options.

Here’s my build file, in ~/workspace/.c9/builders/compass.build

{
    "cmd" : [
        "bash",
        "--login",
        "-c",
        "compass compile /home/ubuntu/workspace/theme"],
    "env" : {},
    "info" : "Compiling SASS in theme directory...",
    "selector": "source.scss"
}

In my files I have:

theme
theme/config.rb
theme/scss
theme/css

config.rb is a compass config file:

environment = :development
firesass = false

# Location of the theme's resources.
css_dir         = "css"
sass_dir        = "sass"
extensions_dir  = "sass-extensions"
images_dir      = "images"
javascripts_dir = "js"

output_style = (environment == :development) ? :expanded : :compressed
relative_assets = true
sass_options = (environment == :development && firesass == true) ? {:debug_info => true} : {}
sourcemap = true

So like this it’ll compile any scss file it finds in the theme/ directory, and put the corresponding css file into the css directory. You just have to switch the builder to your custom builder, called “Compass” in my case:

Hope that helps!
Nate


#3

Thanks so much for this info. Been super busy but Im gonna try this tonight. Iv never used Compass before, I usually use Koala, but Ill give this a shot.

P.S. - Unrelated but maybe you would know the answer, is it true that the free c9 account gives you unlimited workspaces each having some RAM and HDD space (2g’s?) with the ONLY caveat being that anyone can see your code (but can’t edit, I hope). Just wondering because other services similar to c9 usually offer limited numbers of containers or VM’s and with paid versions you get more. Seems that c9 took a different approach and gives you unlimited VMs with paid versions giving you the ability to keep them private. That just seemed a little too good to be true, giving free users the ability to have unlimited workspaces taking up 2 gigs or HDD everytime. Couldnt someone potentially create hundreds of them?


#4

I haven’t tested how unlimited unlimited is, but yes, you understand their offerings correctly. It took me about an hour with the free version to determine I wanted use it for real projects, so I went paid for everyone on my team.

What makes it feasible for them to offer unlimited free VMs, is that only the last 3 VMs you opened remain active – the others are shut down. And with Docker, each VM requires only enough disk space on their end to store your user files, plus a small config file.

So a typical workspace for me is around 100Mb worth of actual files. I have 13 workspaces right now, so the 10 that are paused consume maybe around 1Gb – and no RAM or CPU.


#5

Okay thanks. So Im getting a “bash: compass: command not found” error when compiling. All I did was chang your theme directory to my own, where my css and scss and copy and pasted your config file. The Compass builder is in the list, so that worked at least.


#6

depending on which template you built from you might not have Compass installed. Try

$ gem install compass