Skip to content

Instantly share code, notes, and snippets.

@pschyska
Created November 28, 2010 20:36
Show Gist options
  • Save pschyska/719287 to your computer and use it in GitHub Desktop.
Save pschyska/719287 to your computer and use it in GitHub Desktop.
guard 'shell' do
watch('^coffee/public/(.*)') {|m|
`mkdir -p public/`
filename=m[0].split('coffee/public/')[1]
unless filename.split('.').pop=='coffee'
tmp=filename.split('/')
tmp.pop
target_dir=tmp.join('/')
unless target_dir.empty?
puts "mkdir -p #{'public/' + target_dir}"
`mkdir -p #{'public/' + target_dir}`
end
puts "cp #{m[0]} public/#{filename}"
`cp #{m[0]} public/#{filename}`
end
}
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment