add bin/pharext.update
[pharext/pharext] / src / pharext / Task / PharBuild.php
index 25dd7a42a911ba4f6e7195e5654e8985030f2b1e..d2c06be36d54aa5f41e92a10d1361e60297fd794 100644 (file)
@@ -65,11 +65,8 @@ class PharBuild implements Task
                if ($this->meta) {
                        $phar->setMetadata($this->meta);
                }
-               if (is_file($this->stub)) {
-                       $stub = preg_replace_callback('/^#include <([^>]+)>/m', function($includes) {
-                               return file_get_contents($includes[1], true, null, 5);
-                       }, file_get_contents($this->stub));
-                       $phar->setStub($stub);
+               if ($this->stub) {
+                       (new PharStub($phar, $this->stub))->run($verbose);
                }
 
                $phar->buildFromIterator((new Task\BundleGenerator)->run());