Skip to content

Commit

Permalink
Do git and svn magic. Svn 1.7 required.
Browse files Browse the repository at this point in the history
  • Loading branch information
markjaquith committed Jan 12, 2012
1 parent dda7b75 commit 3aab452
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions lib/wpplugin.rb
Expand Up @@ -22,7 +22,7 @@


class WPPlugin class WPPlugin


VERSION = '0.2-beta' VERSION = '0.2beta1'


def initialize def initialize
command = ARGV.shift command = ARGV.shift
Expand Down Expand Up @@ -56,11 +56,9 @@ def initialize
end end


def update plugin def update plugin
# Gotta add some git and svn magic here for deleted files remove_files plugin
# e.g. svn status . | grep '\!' | awk '{print $2;}' | xargs svn rm
# e.g. git add --all .
remove plugin
add plugin add plugin
`svn status #{plugin} | grep '\!' | awk '{print $2;}' | xargs svn rm`
end end


def update_all def update_all
Expand All @@ -74,12 +72,20 @@ def add plugin
`wget -O #{plugin}.zip #{uri} > /dev/null 2>&1` `wget -O #{plugin}.zip #{uri} > /dev/null 2>&1`
`unzip #{plugin}.zip > /dev/null 2>&1` `unzip #{plugin}.zip > /dev/null 2>&1`
`rm #{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 end


def remove plugin def remove_files plugin
FileUtils.rm_rf plugin if File.directory? plugin FileUtils.rm_rf plugin if File.directory? plugin
end 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 def info
puts "WPPlugin #{self.class::VERSION}" puts "WPPlugin #{self.class::VERSION}"
end end
Expand Down

0 comments on commit 3aab452

Please sign in to comment.