Skip to content

Instantly share code, notes, and snippets.

@sylwit
Created March 9, 2013 11:09
Show Gist options
  • Save sylwit/5123856 to your computer and use it in GitHub Desktop.
Save sylwit/5123856 to your computer and use it in GitHub Desktop.
Git hook for compiling Compass files
#!/usr/bin/env ruby
site_dir = `git rev-parse --show-toplevel`.strip!
themes_dir = site_dir + "/themes"
Dir[ themes_dir + "/*"].each do |theme|
if File.exist?("#{theme}/config.rb")
puts "Compiling Sass for production environment: #{theme}"
system "compass compile -e production --force #{theme}"
system "git add #{theme}/*"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment