do not exit on compression failure
[pharext/pharext] / src / pharext / Packager.php
index 4379bb6ee093c78ed63bfa19776ffbf0e49707ba..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);