#!/usr/bin/env php . */ if (!isset($argv[3])) { echo('Usage: '.$argv[0].' inputDir output.phar ref'.PHP_EOL); die(1); } @unlink($argv[2]); $p = new Phar(__DIR__.'/'.$argv[2], 0, $argv[2]); $p->buildFromDirectory(realpath($argv[1]), '/^((?!tests).)*(\.php|\.py|\.tl|\.json)$/i'); $p->addFromString('.git/refs/heads/master', $argv[3]); $p->setStub('');