Created
May 29, 2009 00:09
-
-
Save lstoll/119683 to your computer and use it in GitHub Desktop.
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
#!/bin/bash | |
cp -R src/main/resources/* target/u.lstoll.net-1.0-SNAPSHOT/WEB-INF/classes | |
cp -R target/classes/* target/u.lstoll.net-1.0-SNAPSHOT/WEB-INF/classes | |
cp -R src/main/webapp/* target/u.lstoll.net-1.0-SNAPSHOT/ |
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
#!/bin/bash | |
trap 'kill $(jobs -p)' INT TERM EXIT | |
mvn package | |
ruby dev_scripts/stakeout.rb dev_scripts/copy_files.sh target/classes src/main/webapp & | |
mvn scala:cc & | |
dev_appserver.sh target/u.lstoll.net-1.0-SNAPSHOT & | |
wait |
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 'pp' | |
if ARGV.size < 2 | |
puts "Usage: stakeout.rb <command> [files to watch]+" | |
exit 1 | |
end | |
command = ARGV.shift | |
files = {} | |
ARGV.each do |arg| | |
Dir[arg+"/**/*"].each { |file| | |
files[file] = File.mtime(file) | |
} | |
end | |
pp files | |
loop do | |
sleep 1 | |
changed_file, last_changed = files.find { |file, last_changed| | |
File.mtime(file) > last_changed | |
} | |
if changed_file | |
files[changed_file] = File.mtime(changed_file) | |
puts "=> #{changed_file} changed, running #{command}" | |
system(command) | |
puts "=> done" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment