From 5a0d9c648cea2c10acdf013087b31e127134481a Mon Sep 17 00:00:00 2001 From: Matthew Weier O'Phinney Date: Wed, 23 Apr 2014 15:43:07 -0500 Subject: [PATCH] Finally got the shebang problem sorted - Added the "extract" and "intercept" flags to phar creation - Stripped the shebang from the script prior to creating the phar --- public/zf-deploy/job.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/public/zf-deploy/job.php b/public/zf-deploy/job.php index 4b6a303f8..ba8ce4b93 100755 --- a/public/zf-deploy/job.php +++ b/public/zf-deploy/job.php @@ -102,6 +102,11 @@ function zfdeploy($version) $deployClass = preg_replace('/(\n\s+const VERSION\s+= \')([^\']+)\';/s', '${1}' . $version . '\';', $deployClass); file_put_contents('src/Deploy.php', $deployClass); + // Strip shebang from script + $script = file_get_contents('bin/zfdeploy.php'); + $script = str_replace("#!/usr/bin/env php\n", '', $script); + file_put_contents('bin/zfdeploy.php', $script); + // Build phar $output = array(); unlink('zfdeploy.phar'); @@ -198,6 +203,8 @@ function createPhar($version, $path) $box->getPhar()->setStub( StubGenerator::create() ->index('bin/zfdeploy.php') + ->extract(true) + ->intercept(true) ->alias('zfdeploy.phar') ->generate() );