@@ -15,7 +15,14 @@ if (in_array('--refresh-running-preview', $argv, true)) {
|
||||
|| ! is_file($private.'/settings.json')) {
|
||||
throw new LogicException('Private review identity mismatch.');
|
||||
}
|
||||
$candidate = storage_path('framework/testing/sgc-distribution-integrated-qa-20261122');
|
||||
$candidateRelative = 'storage/framework/testing/sgc-distribution-integrated-qa-20261122';
|
||||
if (in_array('--candidate', $argv, true)) {
|
||||
$candidateRelative = $argv[array_search('--candidate', $argv, true) + 1] ?? '';
|
||||
}
|
||||
if (! preg_match('~^storage/framework/testing/[A-Za-z0-9_-]+$~D', $candidateRelative)) {
|
||||
throw new LogicException('Only an explicit private candidate can refresh this review.');
|
||||
}
|
||||
$candidate = base_path($candidateRelative);
|
||||
$expected = $argv[array_search('--refresh-running-preview', $argv, true) + 1] ?? '';
|
||||
if (! preg_match('/^[a-f0-9]{64}$/D', $expected) || hash_file('sha256', $candidate.'/manifest.json') !== $expected) {
|
||||
throw new LogicException('Explicit validated private manifest hash required.');
|
||||
@@ -58,8 +65,18 @@ $private = 'C:/laragon/data/sgf-tempo/qa/distribution-visual-'.$database;
|
||||
if (! mkdir($private.'/public', 0700, true) && ! is_dir($private.'/public')) {
|
||||
throw new RuntimeException('Private review directory creation failed.');
|
||||
}
|
||||
$candidate = storage_path('framework/testing/sgc-distribution-integrated-qa-20261122');
|
||||
if (hash_file('sha256', $candidate.'/manifest.json') !== '1edb9ab0aa62fcf4e9c9075ce6e405de5435dc8ea4799d1949535a96c718df4e') {
|
||||
$candidateRelative = 'storage/framework/testing/sgc-distribution-integrated-qa-20261122';
|
||||
$candidateHash = '1edb9ab0aa62fcf4e9c9075ce6e405de5435dc8ea4799d1949535a96c718df4e';
|
||||
if (in_array('--candidate', $argv, true)) {
|
||||
$position = array_search('--candidate', $argv, true);
|
||||
$candidateRelative = $argv[$position + 1] ?? '';
|
||||
$candidateHash = $argv[$position + 2] ?? '';
|
||||
}
|
||||
if (! preg_match('~^storage/framework/testing/[A-Za-z0-9_-]+$~D', $candidateRelative) || ! preg_match('/^[a-f0-9]{64}$/D', $candidateHash)) {
|
||||
throw new LogicException('Explicit private candidate path and hash required.');
|
||||
}
|
||||
$candidate = base_path($candidateRelative);
|
||||
if (hash_file('sha256', $candidate.'/manifest.json') !== $candidateHash) {
|
||||
throw new RuntimeException('The private candidate differs from the validated build.');
|
||||
}
|
||||
(new Filesystem)->copyDirectory($candidate, $private.'/public/build');
|
||||
|
||||
Reference in New Issue
Block a user