Created
February 1, 2010 23:10
-
-
Save calvinf/292152 to your computer and use it in GitHub Desktop.
Get WordPress plugins from SVN
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use strict; | |
use constant PLUGIN_DIR => 'http://svn.wp-plugins.org/'; | |
#argument 1 should be file name with 1 plugin slug per line | |
while(<>) { | |
chomp; | |
checkout($_); | |
} | |
sub checkout { | |
my $plugin_name = shift; | |
my $plugin_url = PLUGIN_DIR . $plugin_name . '/trunk/'; | |
if (-d $plugin_name) { | |
print "Updating $plugin_name from SVN.\n"; | |
chdir($plugin_name); | |
`sudo svn up`; | |
chdir('..'); | |
} | |
else { | |
print "Doing initial checkout of $plugin_name.\n"; | |
`sudo svn co ${plugin_url} ${plugin_name}`; | |
} | |
} | |
1; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment