Skip to content

Instantly share code, notes, and snippets.

@calvinf
Created February 1, 2010 23:10
Show Gist options
  • Save calvinf/292152 to your computer and use it in GitHub Desktop.
Save calvinf/292152 to your computer and use it in GitHub Desktop.
Get WordPress plugins from SVN
#!/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