Skip to content

Commit

Permalink
Exclude vendor test files from build
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicolas Oelgart committed Apr 22, 2019
1 parent 6723a42 commit b3bd550
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions bin/create-phar
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,25 @@ if (is_file($pharFile)) {
unlink($pharFile);
}

$finder = (new Finder)->files()->in([
$dirs = [
$baseDir . '/app',
$baseDir . '/src',
$baseDir . '/vendor'
]);
];

$finder = (new Finder())
->files()
->in($dirs)
->name('/\.(php|yml)$/')
->notPath('Tests');

$stub = "#!/usr/bin/env php\n";
$stub .= "<?php Phar::mapPhar('headsec.phar');\n";
$stub .= "require 'phar://headsec.phar/app/run.php';\n";
$stub .= "__HALT_COMPILER();";

$phar = new Phar($pharFile);
$phar->setStub("#!/usr/bin/env php\n<?php Phar::mapPhar('headsec.phar'); require 'phar://headsec.phar/app/run.php'; __HALT_COMPILER();");
$phar->setStub($stub);
$phar->compress(Phar::GZ);
$phar->buildFromIterator($finder->getIterator(), $baseDir);

Expand Down

0 comments on commit b3bd550

Please sign in to comment.