lib/awestruct/commands/deploy.rb in awestruct-0.1.9 vs lib/awestruct/commands/deploy.rb in awestruct-0.2.0

- old
+ new

@@ -10,22 +10,31 @@ @path = File.join( opts['path'], '/' ) end def run cmd = "rsync -r -l -i --no-p --no-g --chmod=Dg+s,ug+w --delete #{@site_path} #{@host}:#{@path}" - puts "running #{cmd}" - Open3.popen3( cmd ) do |stdin, stdout, stderr| + Open3.popen3( cmd ) do |stdin, stdout, stderr| stdin.close threads = [] threads << Thread.new(stdout) do |i| while ( ! i.eof? ) - line = i.readline - puts line + line = i.readline + case line[0,9] + when '<f.sT....' + puts " updating #{line[10..-1]}" + when '<f+++++++' + puts " adding #{line[10..-1]}" + when '<f..T....' + # ignoring unchanged files + # puts " no change to #{line[10..-1]}" + else + puts line + end end end threads << Thread.new(stderr) do |i| while ( ! i.eof? ) - line = i.readline + line = i.readline puts line end end threads.each{|t|t.join} end