-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdzlab-update.pl
executable file
·43 lines (37 loc) · 990 Bytes
/
dzlab-update.pl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/usr/bin/env perl
use strict;
use warnings;
use Data::Dumper;
use feature 'say';
use FindBin qw($Bin);
use File::Spec;
my $gitname = $^O eq 'MSWin32' ? 'git.exe' : 'git';
#if (! grep { -e File::Spec->catfile($_,$gitname) } File::Spec->path){
#die "Can't find Git source code management software in PATH";
#}
chdir $Bin;
say 'u) Update DZLab-Tools to latest version';
say 'c) Checkout older version via graphical interface';
say 'q) Quit';
print 'enter u, c, or q: ';
while (my $response = <>){
chomp $response;
if ($response eq 'u'){
system(qw/git fetch/);
system(qw{git checkout remotes/origin/HEAD});
last;
}
elsif ($response eq 'c'){
system(qw/gitk --all/);
last;
}
elsif ($response eq 'q'){
last;
}
else {
say 'u) Update DZLab-Tools to latest version';
say 'c) Checkout older version via graphical interface';
say 'q) Quit';
print 'enter u, c, or q: ';
}
}