Permalink
Browse files

Do git and svn magic. Svn 1.7 required.

  • Loading branch information...
1 parent dda7b75 commit 3aab4526f644600ce44bb335ba1019ab7214248d @markjaquith committed Jan 12, 2012
Showing with 12 additions and 6 deletions.
  1. +12 −6 lib/wpplugin.rb
View
@@ -22,7 +22,7 @@
class WPPlugin
- VERSION = '0.2-beta'
+ VERSION = '0.2beta1'
def initialize
command = ARGV.shift
@@ -56,11 +56,9 @@ def initialize
end
def update plugin
- # Gotta add some git and svn magic here for deleted files
- # e.g. svn status . | grep '\!' | awk '{print $2;}' | xargs svn rm
- # e.g. git add --all .
- remove plugin
+ remove_files plugin
add plugin
+ `svn status #{plugin} | grep '\!' | awk '{print $2;}' | xargs svn rm`
end
def update_all
@@ -74,12 +72,20 @@ def add plugin
`wget -O #{plugin}.zip #{uri} > /dev/null 2>&1`
`unzip #{plugin}.zip > /dev/null 2>&1`
`rm #{plugin}.zip > /dev/null 2>&1`
+ `svn add --force #{plugin} > /dev/null 2>&1`
+ `git add --all #{plugin} > /dev/null 2>&1`
end
- def remove plugin
+ def remove_files plugin
FileUtils.rm_rf plugin if File.directory? plugin
end
+ def remove plugin
+ remove_files plugin
+ `svn rm #{plugin} > /dev/null 2>&1`
+ `git rm -r #{plugin} > /dev/null 2>&1`
+ end
+
def info
puts "WPPlugin #{self.class::VERSION}"
end

0 comments on commit 3aab452

Please sign in to comment.