rjw | 6c1fd8f | 2022-11-30 14:33:01 +0800 | [diff] [blame] | 1 | #!/usr/local/bin/perl
|
| 2 |
|
| 3 | use Win32;
|
| 4 |
|
| 5 | my $cwd = Win32::GetCwd();
|
| 6 |
|
| 7 | my $upper_cwd = $cwd;
|
| 8 |
|
| 9 | my $upper_folder;
|
| 10 |
|
| 11 | print " cwd == \"$cwd\" \n";
|
| 12 |
|
| 13 |
|
| 14 | if ( $cwd =~ /[\s\w]*\\([\s\w]+)/ )
|
| 15 | {
|
| 16 | if ( "$1" ne "" )
|
| 17 | {
|
| 18 | print "I got upper folder == \"$1\" \n";
|
| 19 | $upper_folder = "$1";
|
| 20 | } else
|
| 21 | {
|
| 22 | print " We can not match upper folder \n";
|
| 23 | }
|
| 24 | } else
|
| 25 | {
|
| 26 | print " We can not match upper folder \n";
|
| 27 | }
|
| 28 |
|
| 29 | $upper_cwd =~ s/$upper_folder//;
|
| 30 | $upper_folder =~ s/\s/_/;
|
| 31 |
|
| 32 | if ( -e "c:\\progra~1\\7-zip\\7z.exe" )
|
| 33 | {
|
| 34 | system "date/t & time/t";
|
| 35 | print "cd build & del *.obj /s /q ";
|
| 36 | system "cd build & del *.obj /s /q ";
|
| 37 | print "c:\\progra~1\\7-zip\\7z.exe a -mx=5 -r ${upper_cwd}${upper_folder}.7z $cwd \n";
|
| 38 | system "c:\\progra~1\\7-zip\\7z.exe a -mx=5 -r ${upper_cwd}${upper_folder}.7z $cwd \n";
|
| 39 | system "date/t & time/t";
|
| 40 |
|
| 41 | } else
|
| 42 | {
|
| 43 | print " c:\\progra~1\\7-zip\\7z.exe not found \n";
|
| 44 | }
|
| 45 |
|
| 46 |
|
| 47 |
|
| 48 | exit 0;
|