init
This commit is contained in:
Executable
+6
@@ -0,0 +1,6 @@
|
||||
#!/usr/bin/env sh
|
||||
set -eu
|
||||
cd "$(dirname "$0")/.."
|
||||
php tests/run.php
|
||||
php -d phar.readonly=0 build/phar.php
|
||||
php dist/wm.phar --version
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
$root = dirname(__DIR__);
|
||||
$target = $root . '/dist/wm.phar';
|
||||
if (ini_get('phar.readonly')) {
|
||||
fwrite(STDERR, "PHAR creation is disabled; run php -d phar.readonly=0 build/phar.php\n");
|
||||
exit(1);
|
||||
}
|
||||
if (file_exists($target)) {
|
||||
unlink($target);
|
||||
}
|
||||
$phar = new Phar($target, 0, 'wm.phar');
|
||||
$phar->startBuffering();
|
||||
foreach (['bin/wm', 'src/autoload.php', 'src/App.php', 'src/Runtime.php', 'src/Registry.php', 'src/Project.php', 'src/Systemd.php', 'src/Process.php', 'src/UI.php'] as $path) {
|
||||
$phar->addFile($root . '/' . $path, $path);
|
||||
}
|
||||
$stub = <<<'STUB'
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
Phar::mapPhar('wm.phar');
|
||||
require 'phar://wm.phar/bin/wm';
|
||||
__HALT_COMPILER();
|
||||
STUB;
|
||||
$phar->setStub($stub . "\n");
|
||||
$phar->setSignatureAlgorithm(Phar::SHA256);
|
||||
$phar->stopBuffering();
|
||||
chmod($target, 0755);
|
||||
echo "Built {$target} (" . number_format(filesize($target)) . " bytes)\n";
|
||||
Reference in New Issue
Block a user