From 52de65e52ba3a4d332972588570aa6feab65a14c Mon Sep 17 00:00:00 2001 From: Anton Afanasyeu Date: Fri, 10 Jul 2026 22:12:02 +0200 Subject: [PATCH] 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 --- src/BuildRunner.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/BuildRunner.php b/src/BuildRunner.php index e9ed74c..f10f56f 100644 --- a/src/BuildRunner.php +++ b/src/BuildRunner.php @@ -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') + ); + } } } }