File tree 1 file changed +7
-2
lines changed
1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,8 @@ use Time::Local;
14
14
require (dirname(__FILE__ ) . ' /file-manager-lib.pm' );
15
15
16
16
my $command ;
17
- my $extension = " tar.gz" ;
17
+ my $has_zip = has_command(' zip' );
18
+ my $extension = $has_zip ? " zip" : " tar.gz" ;
18
19
my $filename = $in {' filename' };
19
20
my $target = tempname(" $filename .$extension " );
20
21
@@ -41,8 +42,12 @@ if ($in{'cancel'} eq '1') {
41
42
}
42
43
}
43
44
} else {
45
+ if ($has_zip ) {
46
+ $command = " cd " . quotemeta ($cwd ) . " && zip -r " . quotemeta ($target );
47
+ } else {
48
+ $command = " tar czf " . quotemeta ($target ) . " -C " . quotemeta ($cwd );
49
+ }
44
50
45
- $command = " tar czf " . quotemeta ($target ) . " -C " . quotemeta ($cwd );
46
51
foreach my $name (split (/ \0 / , $in {' name' })) {
47
52
$name =~ s / $in{'cwd'}\/ // ig ;
48
53
if (-e ($cwd . ' /' . $name )) {
You can’t perform that action at this time.
0 commit comments