Sha256: 8191dfc1969a855f0426acd48ba3257cd7bd2b31c5ba263f016e8668789190f3

Contents?: true

Size: 1.04 KB

Versions: 4

Compression:

Stored size: 1.04 KB

Contents

puts __FILE__ if defined?(DEBUG)

desc 'adds source files to git or subversion'
task :add do Tasks.execute_task :add;end

class Add < Array
	def update
		if(File.exists?('.git') && File.exists?('.gitignore'))
			add 'git add --all' 
		else
			if(defined?(SOURCE))
				if(File.exists?('.svn'))
					SOURCE.each{|f|
						if(File.exists?(f) && File.file?(f))
	                        status=Command.output("svn status #{f}")
	                        error=Command.error("svn status #{f}")
	                        if(status.include?('?') || status.include?('was not found') || error.include?('was not found'))
								puts "svn add #{f} --parents"
								add "svn add #{f} --parents"
							end
						end
					}
				end
				if(File.exists?('.git'))
					SOURCE.each{|f|
						if(File.exists?(f) && File.file?(f))
						  status=`git status #{f} --short`
						  if status.include?('??') || status.include?(' M ')
							puts "git add #{f} -v"
							add "git add #{f} -v" 
						  end
					    end
					}
				end
			end
		end
	end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
dev-2.0.198 lib/tasks/add.rb
dev-2.0.197 lib/tasks/add.rb
dev-2.0.196 lib/tasks/add.rb
dev-2.0.195 lib/tasks/add.rb