Skip to content

Commit a8ac932

Browse files
committed
Slightly improve build script
1 parent ff8a045 commit a8ac932

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

bin/build

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@ $pharContent = str_replace('LEN = 6646', 'LEN = 6629', $pharContent);
6969
$signatureSuffix = substr($pharContent, -8);
7070
$pharData = substr($pharContent, 0, -40);
7171
$newSignature = hash('sha256', $pharData, true) . $signatureSuffix;
72-
file_put_contents($pharFile, $pharData . $newSignature);
72+
$pharContent = $pharData . $newSignature;
73+
file_put_contents($pharFile, $pharContent);
7374

7475
$minPhpVersion = trim($phar['PHP_VERSION']->getContent());
7576
// Rewrite the resulting file to support dynamic executor
@@ -84,7 +85,7 @@ $bash = implode(PHP_EOL, [
8485
"php_file=\"\$tmp\"/{$opts['package']}.phar",
8586
'self_ts=$(date -r "$0" +%s)',
8687
'phar_ts=$(test -f "$php_file" && date -r $_ +%s || echo 0)',
87-
'test "$self_ts" -gt "$phar_ts" && echo \'<?php file_put_contents("\'$php_file\'", hex2bin("' . bin2hex(file_get_contents($pharFile)) . '"));\' | $executor',
88+
'test "$self_ts" -gt "$phar_ts" && echo \'<?php file_put_contents("\'$php_file\'", hex2bin("' . bin2hex($pharContent) . '"));\' | $executor',
8889
// 'EOF',
8990
'exec $executor -n "$php_file" "$@"',
9091
'',

0 commit comments

Comments
 (0)