Skip to content

Instantly share code, notes, and snippets.

@fujimogn
Created December 5, 2012 02:08
Show Gist options
  • Save fujimogn/4211484 to your computer and use it in GitHub Desktop.
Save fujimogn/4211484 to your computer and use it in GitHub Desktop.
livereload for wordless gem
# A sample Guardfile
# More info at https://github.com/guard/guard#readme
# wordless
guard :shell do
# sass & less
watch(%r{^wp-content/themes/(\w+)/theme/assets/(.+)\.(s[ac]ss|less|css)$}){|m|
`rm -rf wp-content/themes/#{m[1]}/tmp/* && wordless clean && wordless compile`
}
# coffeescript & javascript
watch(%r{^wp-content/themes/(\w+)/theme/assets/(.+)\.(coffee|js)$}){|m|
`rm -rf wp-content/themes/#{m[1]}/tmp/* && wordless clean && wordless compile`
}
end
# livereload
guard 'livereload' do
# view
watch(%r{^wp-content/themes/\w+/theme/views/(.+)\.haml$})
# config
watch(%r{^wp-content/themes/\w+/config/(.+)\.(php|inc)$})
# static assets
watch(%r{^wp-content/themes/\w+/assets/(.+)/})
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment