Last active
December 20, 2015 13:39
-
-
Save fujimura/6140013 to your computer and use it in GitHub Desktop.
Script to watch and compile cabal project
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
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