exec7z.pl
894 Bytes
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
43
44
45
46
47
48
#!/usr/local/bin/perl
use Win32;
my $cwd = Win32::GetCwd();
my $upper_cwd = $cwd;
my $upper_folder;
print " cwd == \"$cwd\" \n";
if ( $cwd =~ /[\s\w]*\\([\s\w]+)/ )
{
if ( "$1" ne "" )
{
print "I got upper folder == \"$1\" \n";
$upper_folder = "$1";
} else
{
print " We can not match upper folder \n";
}
} else
{
print " We can not match upper folder \n";
}
$upper_cwd =~ s/$upper_folder//;
$upper_folder =~ s/\s/_/;
if ( -e "c:\\progra~1\\7-zip\\7z.exe" )
{
system "date/t & time/t";
print "cd build & del *.obj /s /q ";
system "cd build & del *.obj /s /q ";
print "c:\\progra~1\\7-zip\\7z.exe a -mx=5 -r ${upper_cwd}${upper_folder}.7z $cwd \n";
system "c:\\progra~1\\7-zip\\7z.exe a -mx=5 -r ${upper_cwd}${upper_folder}.7z $cwd \n";
system "date/t & time/t";
} else
{
print " c:\\progra~1\\7-zip\\7z.exe not found \n";
}
exit 0;