Skip to content

Instantly share code, notes, and snippets.

@Kevnz
Created March 30, 2011 20:59
Show Gist options
  • Save Kevnz/895290 to your computer and use it in GitHub Desktop.
Save Kevnz/895290 to your computer and use it in GitHub Desktop.
Compass config
watch 'src/main/web/**/*' do | project_dir, relative_path |
dest_dir = File.join(project_dir, 'web')
src_path = File.join(project_dir, relative_path)
extn = File.extname(relative_path)
filename = File.basename(src_path, extn)
if extn == '.js'
parent_dir = File.join(dest_dir, parent_dir(src_path))
dest_path = File.join(parent_dir, filename + extn)
Dir.mkdir(dest_dir) unless File.exists?(dest_dir) && File.directory?(dest_dir)
Dir.mkdir(parent_dir) unless File.exists?(parent_dir) && File.directory?(parent_dir)
File.copy(src_path, dest_path, true)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment