1
0
mirror of git://f0xx.org/ac/ac-ms-build synced 2026-07-29 04:17:39 +03:00

fix(build): correct OTA channel JSON copy in publishOta

Stop embedding shell redirection inside escapeshellarg and skip copy when the channel file is missing.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Anton Afanasyeu
2026-07-10 22:12:02 +02:00
parent 52afe728c2
commit 52de65e52b

View File

@@ -537,7 +537,15 @@ YAML;
$dest = $mount . '/v0';
shell_exec('mkdir -p ' . escapeshellarg($dest) . ' && cp -a ' . escapeshellarg($src . '/.') . ' ' . escapeshellarg($dest . '/'));
if ($channel !== '' && $channel !== 'staging') {
shell_exec('cp -a ' . escapeshellarg($src . '/ota/channel/' . $channel . '.json') . ' ' . escapeshellarg($dest . '/ota/channel/' . $channel . '.json 2>/dev/null'));
$channelJson = $src . '/ota/channel/' . $channel . '.json';
if (is_file($channelJson)) {
shell_exec(
'cp -a '
. escapeshellarg($channelJson)
. ' '
. escapeshellarg($dest . '/ota/channel/' . $channel . '.json')
);
}
}
}
}