Skip to content

Instantly share code, notes, and snippets.

@fujimura
Last active December 20, 2015 13:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fujimura/6140013 to your computer and use it in GitHub Desktop.
Save fujimura/6140013 to your computer and use it in GitHub Desktop.
Script to watch and compile cabal project
require 'listen'
Listen.to! 'test', 'src', filter: /.*\.hs/ do |modified, added, removed|
system %|clear|
p modified
p added
p removed
if File.exists? "Rakefile"
system %|rake|
else
system %|cabal configure --enable-tests && cabal build && cabal test|
end
end
Signal.trap 'INT' do
exit
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment