Permalink
Browse files

zip task: supports .tgz

  • Loading branch information...
1 parent 34252a4 commit a116e605a48bf2aa52cbfe2d1e100deacbc47e08 @dg dg committed Jan 20, 2012
Showing with 8 additions and 3 deletions.
  1. +8 −3 tasks/zip.php
View
@@ -13,12 +13,17 @@
$project->zip = function($archive, $items) use ($project) {
$project->log("Creating archive $archive");
- if ($tarArchive = strpos($archive, '.tar.')) {
+ if (substr($archive, -4) === '.tgz') {
+ $tarArchive = substr($archive, 0, -3) . 'tar';
+ } elseif ($tarArchive = strpos($archive, '.tar.')) {
$tarArchive = substr($archive, 0, $tarArchive + 4);
+ }
+
+ if ($tarArchive) {
$project->zip($tarArchive, $items);
$items = $tarArchive;
}
-
+
$cmd = escapeshellarg($project->zipExecutable) . ' a -mx9 ' . escapeshellarg($archive);
foreach ((array) $items as $item) {
$cmd .= ' ' . escapeshellarg($item);
@@ -29,7 +34,7 @@
}
$project->exec($cmd);
-
+
if ($tarArchive) {
unlink($tarArchive);
}

0 comments on commit a116e60

Please sign in to comment.