schneespur/vendor/psy/psysh/scripts/build-stub
Michael 2c63440ed8 Revert: move code back to project root from schneespur/ subdirectory
- Reverts the schneespur/ subdirectory restructure (b8e426b)
- Restores package.json and vite.config.js (needed for npm build, were
  removed in an earlier cleanup before the restructure)
- Updates public/build/ assets with current Vite output (new content hashes)
2026-05-17 18:24:26 +00:00

22 lines
741 B
PHP
Executable file

#!/usr/bin/env php
<?php
$license = file_get_contents(dirname(__DIR__) . '/LICENSE');
$license = str_replace('The MIT License (MIT)', '', $license);
$license = str_replace("\n", "\n * ", trim($license));
$autoload = <<<'EOS'
Phar::mapPhar('psysh.phar');
require 'phar://psysh.phar/.box/bin/check-requirements.php';
require 'phar://psysh.phar/vendor/autoload.php';
EOS;
$content = file_get_contents(dirname(__DIR__) . '/bin/psysh');
$content = preg_replace('{/\* <<<.*?>>> \*/}sm', $autoload, $content);
$content = preg_replace('/\\(c\\) .*?with this source code./sm', $license, $content);
$content .= '__HALT_COMPILER();';
@mkdir(dirname(__DIR__) . '/build');
file_put_contents(dirname(__DIR__) . '/build/stub', $content);