source: osm/applications/editors/josm/plugins/github@ 36364

Last change on this file since 36364 was 36364, checked in by stoecker, 12 months ago

add reset option

  • Property svn:executable set to *
File size: 852 bytes
Line 
1#!/usr/bin/perl
2
3use strict;
4use Cwd;
5
6open(my $file, '<', 'github_plugins') or die;
7
8if(($ARGV[0]||'') eq 'checkout')
9{
10 for my $plugin (<$file>)
11 {
12 chomp($plugin);
13 system('git','clone',"https://github.com/JOSM/$plugin");
14 }
15}
16elsif(($ARGV[0]||'') eq 'status')
17{
18 my $dir = cwd();
19 for my $plugin (<$file>)
20 {
21 print($plugin);
22 chomp($plugin);
23 chdir($plugin);
24 system('git','status');
25 chdir($dir);
26 }
27}
28elsif(($ARGV[0]||'') eq 'reset')
29{
30 my $dir = cwd();
31 for my $plugin (<$file>)
32 {
33 print($plugin);
34 chomp($plugin);
35 chdir($plugin);
36 system('git','reset','--hard','HEAD');
37 system('git','pull');
38 chdir($dir);
39 }
40}
41else
42{
43 my $dir = cwd();
44 for my $plugin (<$file>)
45 {
46 print($plugin);
47 chomp($plugin);
48 chdir($plugin);
49 system('git','pull');
50 chdir($dir);
51 }
52}
53close($file);
Note: See TracBrowser for help on using the repository browser.