Skip to content
This repository has been archived by the owner on Dec 7, 2019. It is now read-only.

Commit

Permalink
Finally got the shebang problem sorted
Browse files Browse the repository at this point in the history
- Added the "extract" and "intercept" flags to phar creation
- Stripped the shebang from the script prior to creating the phar
  • Loading branch information
weierophinney committed Apr 23, 2014
1 parent ca6a4f4 commit 5a0d9c6
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions public/zf-deploy/job.php
Expand Up @@ -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');
Expand Down Expand Up @@ -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()
);
Expand Down

0 comments on commit 5a0d9c6

Please sign in to comment.