do not exit on compression failure
[pharext/pharext] / src / pharext / Packager.php
index 3408c75d8b0ac8c637c93a423cea631167fa6499..a848e2d39ce672fc5a0ff67dfb652376d526c2e8 100644 (file)
@@ -158,13 +158,21 @@ class Packager implements Command
                        }
                        if ($this->args->gzip) {
                                $this->info("Compressing with gzip ... ");
-                               $package->compress(Phar::GZ);
-                               $this->info("OK\n");
+                               try {
+                                       $package->compress(Phar::GZ);
+                                       $this->info("OK\n");
+                               } catch (\Exception $e) {
+                                       $this->error("%s\n", $e->getMessage());
+                               }
                        }
                        if ($this->args->bzip) {
                                $this->info("Compressing with bzip ... ");
-                               $package->compress(Phar::BZ2);
-                               $this->info("OK\n");
+                               try {
+                                       $package->compress(Phar::BZ2);
+                                       $this->info("OK\n");
+                               } catch (\Exception $e) {
+                                       $this->error("%s\n", $e->getMessage());
+                               }
                        }
                        
                        unset($package);
@@ -174,7 +182,7 @@ class Packager implements Command
                }
 
                foreach (glob($pkgtemp."*") as $pkgtemp) {
-                       $pkgfile = str_replace($pkguniq, "{$pkgdesc}-ext", $pkgtemp);
+                       $pkgfile = str_replace($pkguniq, "{$pkgdesc}.ext", $pkgtemp);
                        $pkgname = $this->args->dest ."/". basename($pkgfile);
                        $this->info("Finalizing %s ... ", $pkgname);
                        if (!rename($pkgtemp, $pkgname)) {