lib/add.rb in dev_commands-0.0.17 vs lib/add.rb in dev_commands-0.0.18
- old
+ new
@@ -1,9 +1,20 @@
-class Add < Array
- def update
- if(File.exists?('.gitignore'))
- add 'git add --all'
- else
-
- end
- end
+class Add < Array
+ def update
+ if(File.exists?('.gitignore'))
+ add 'git add --all'
+ else
+ if(defined?(SOURCE))
+ if(File.exists?('.svn'))
+ SOURCE.each{|f|
+ add "svn add #{f}" if `svn status #{f}`.include?('?')
+ }
+ end
+ if(File.exists?('.git'))
+ SOURCE.each{|f|
+ add "git add #{f} -v" if `git status #{f}`.include?('untracked')
+ }
+ end
+ end
+ end
+ end
end
\ No newline at end of file