Make sure you have installed drush and the proper Guard extensions (shell, compass and livereload)
Last active
August 29, 2015 14:00
-
-
Save stdekker/11292518 to your computer and use it in GitHub Desktop.
Drupal theme + compass + guard + livereload
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ~/.guardfile | |
# Based on work by: https://gist.github.com/dvessel | |
# More info at https://github.com/guard/guard#readme | |
notification :off | |
puts "Using default guard file." | |
group :development do | |
if File.exists?("./config.rb") | |
# Compile on start. | |
puts `compass compile --time --quiet` | |
# https://github.com/guard/guard-compass | |
guard :compass do | |
watch(%r{(.*)\.s[ac]ss$}) | |
end | |
end | |
## Clear caches on update of info-file | |
if Dir.glob("*.info").any? | |
guard :shell do | |
puts 'Monitoring theme info file.' | |
watch(%r{.*\.info$}) { |m| | |
puts 'Change detected: ' + m[0] | |
`drush cache-clear "theme-registry" -y` | |
puts 'Cleared info caches.' | |
} | |
end | |
end | |
# https://github.com/guard/guard-livereload. | |
guard :livereload do | |
watch(%r{.+\.(scss|css|js|html?|php|inc|theme)$}) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment