I've changed lib/piston/command.rb line 43 from:
raise "Command #{command} resulted in an error:\n\n#{result}" unless $?.exitstatus.zero?
to
# Walter McGinnis, 2007-12-30
# handle cases where
# the file or directory has already been added to svn repository
# or the file or directory has already been deleted
unless $?.exitstatus.zero?
should_raise = true
path_arg = args.last.to_s
# this could probably be more succint to check that
# that the file has also been added to version control
svn_status = `svn status --verbose #{path_arg}`
case args[0].to_s
when 'remove'
# if it has already been deleted, just skip
should_raise = false if !File.exists?(path_arg) and svn_status.empty?
when *['add', 'mkdir']
# if it has already been added to repository, just skip
should_raise = false if File.exists?(path_arg) and !svn_status.empty?
end
raise "Command #{command} resulted in an error:\n\n#{result}" if should_raise
end
Still warns about the missing or already existing files, but continues on. What do you think?
Cheers,
Walter |