diff --git a/cli/release_publish.php b/cli/release_publish.php index fb5b3fd..2cb5cee 100644 --- a/cli/release_publish.php +++ b/cli/release_publish.php @@ -123,7 +123,7 @@ if ($bumpType !== 'none') { $bumpFlag = $bumpType === 'minor' ? '--minor' : ''; echo "\n--- Step 1: Version bump ({$bumpType}) ---\n"; if (!$dryRun) { - passthru("{$php} {$cli}/version_bump.php --path " . escapeshellarg($path) . " {$bumpFlag} 2>&1"); + passthru($php . ' ' . $cli . '/version_bump.php --path " . escapeshellarg($path) . " {$bumpFlag} 2>&1"); } else { echo "[DRY-RUN] Would run version_bump.php {$bumpFlag}\n"; } @@ -132,7 +132,7 @@ if ($bumpType !== 'none') { // -- Step 2: Read version and set stability suffix -- echo "\n--- Step 2: Set version suffix ---\n"; $versionOutput = []; -exec("{$php} {$cli}/version_read.php --path " . escapeshellarg($path) . " 2>/dev/null", $versionOutput); +exec($php . ' ' . $cli . '/version_read.php --path " . escapeshellarg($path) . " 2>/dev/null", $versionOutput); $version = trim($versionOutput[0] ?? ''); if (empty($version)) { fwrite(STDERR, "No version found\n"); @@ -142,11 +142,11 @@ if (empty($version)) { $baseVersion = preg_replace('/(-(dev|alpha|beta|rc))+$/', '', $version); if (!$dryRun) { - passthru("{$php} {$cli}/version_set_platform.php --path " . escapeshellarg($path) + passthru($php . ' ' . $cli . '/version_set_platform.php --path " . escapeshellarg($path) . " --version " . escapeshellarg($baseVersion) . " --branch " . escapeshellarg($branch) . " --stability " . escapeshellarg($stability) . " 2>&1"); - passthru("{$php} {$cli}/version_check.php --path " . escapeshellarg($path) . " --fix 2>/dev/null"); + passthru($php . ' ' . $cli . '/version_check.php --path " . escapeshellarg($path) . " --fix 2>/dev/null"); } $releaseVersion = $baseVersion . $suffixMap[$stability]; @@ -154,12 +154,12 @@ echo "Release version: {$releaseVersion}\n"; // -- Step 2b: Update badges and changelog -- if (!$dryRun) { - passthru("{$php} {$cli}/badge_update.php --path " . escapeshellarg($path) . " --version " . escapeshellarg($baseVersion) . " 2>/dev/null"); + passthru($php . ' ' . $cli . '/badge_update.php --path " . escapeshellarg($path) . " --version " . escapeshellarg($baseVersion) . " 2>/dev/null"); $changelogFile = realpath($path) . '/CHANGELOG.md'; if (file_exists($changelogFile)) { - passthru("{$php} {$cli}/changelog_promote.php --path " . escapeshellarg($path) . " --version " . escapeshellarg($baseVersion) . " 2>/dev/null"); - passthru("{$php} {$cli}/changelog_prune.php --path " . escapeshellarg($path) . " --keep 5 2>/dev/null"); + passthru($php . ' ' . $cli . '/changelog_promote.php --path " . escapeshellarg($path) . " --version " . escapeshellarg($baseVersion) . " 2>/dev/null"); + passthru($php . ' ' . $cli . '/changelog_prune.php --path " . escapeshellarg($path) . " --keep 5 2>/dev/null"); } } @@ -178,12 +178,12 @@ if (!$dryRun) { @shell_exec("cd " . escapeshellarg($root) . " && git checkout -B " . escapeshellarg($branch) . " FETCH_HEAD 2>/dev/null"); // Re-apply version changes on the checked-out branch - passthru("{$php} {$cli}/version_set_platform.php --path " . escapeshellarg($path) + passthru($php . ' ' . $cli . '/version_set_platform.php --path " . escapeshellarg($path) . " --version " . escapeshellarg($baseVersion) . " --branch " . escapeshellarg($branch) . " --stability " . escapeshellarg($stability) . " 2>/dev/null"); - passthru("{$php} {$cli}/version_check.php --path " . escapeshellarg($path) . " --fix 2>/dev/null"); - passthru("{$php} {$cli}/badge_update.php --path " . escapeshellarg($path) . " --version " . escapeshellarg($baseVersion) . " 2>/dev/null"); + passthru($php . ' ' . $cli . '/version_check.php --path " . escapeshellarg($path) . " --fix 2>/dev/null"); + passthru($php . ' ' . $cli . '/badge_update.php --path " . escapeshellarg($path) . " --version " . escapeshellarg($baseVersion) . " 2>/dev/null"); $diffCheck = trim((string) @shell_exec("cd " . escapeshellarg($root) . " && git diff --quiet && git diff --cached --quiet 2>&1 && echo clean || echo dirty")); if ($diffCheck === 'dirty') { @@ -203,7 +203,7 @@ $sha256 = ''; if (!$dryRun) { // Create release - passthru("{$php} {$cli}/release_create.php --path " . escapeshellarg($path) + passthru($php . ' ' . $cli . '/release_create.php --path " . escapeshellarg($path) . " --version " . escapeshellarg($releaseVersion) . " --tag " . escapeshellarg($releaseTag) . " --token " . escapeshellarg($token) @@ -213,7 +213,7 @@ if (!$dryRun) { // Build and upload package $packageOutput = []; - exec("{$php} {$cli}/release_package.php --path " . escapeshellarg($path) + exec($php . ' ' . $cli . '/release_package.php --path " . escapeshellarg($path) . " --version " . escapeshellarg($releaseVersion) . " --tag " . escapeshellarg($releaseTag) . " --token " . escapeshellarg($token) @@ -252,13 +252,13 @@ for ($i = 0; $i < $stabilityIndex; $i++) { if (!$dryRun) { // Set version to lesser stream's suffixed version in source files - passthru("{$php} {$cli}/version_set_platform.php --path " . escapeshellarg($path) + passthru($php . ' ' . $cli . '/version_set_platform.php --path " . escapeshellarg($path) . " --version " . escapeshellarg($baseVersion) . " --branch " . escapeshellarg($lesserStability) . " --stability " . escapeshellarg($lesserStability) . " 2>/dev/null"); // Create release tag - passthru("{$php} {$cli}/release_create.php --path " . escapeshellarg($path) + passthru($php . ' ' . $cli . '/release_create.php --path " . escapeshellarg($path) . " --version " . escapeshellarg($lesserVersion) . " --tag " . escapeshellarg($lesserTag) . " --token " . escapeshellarg($token) @@ -267,7 +267,7 @@ for ($i = 0; $i < $stabilityIndex; $i++) { . " --branch " . escapeshellarg($branch) . " 2>&1"); // Build and upload package (ZIP will contain the lesser version) - passthru("{$php} {$cli}/release_package.php --path " . escapeshellarg($path) + passthru($php . ' ' . $cli . '/release_package.php --path " . escapeshellarg($path) . " --version " . escapeshellarg($lesserVersion) . " --tag " . escapeshellarg($lesserTag) . " --token " . escapeshellarg($token) @@ -281,7 +281,7 @@ for ($i = 0; $i < $stabilityIndex; $i++) { // Restore primary release version in source files if (!$dryRun && $stabilityIndex > 0) { - passthru("{$php} {$cli}/version_set_platform.php --path " . escapeshellarg($path) + passthru($php . ' ' . $cli . '/version_set_platform.php --path " . escapeshellarg($path) . " --version " . escapeshellarg($baseVersion) . " --branch " . escapeshellarg($branch) . " --stability " . escapeshellarg($stability) . " 2>/dev/null"); @@ -298,7 +298,7 @@ foreach ($streamsToWrite as $stream) { echo " Writing {$stream} stream: {$streamVersion}\n"; if (!$dryRun) { - passthru("{$php} {$cli}/updates_xml_build.php --path " . escapeshellarg($path) + passthru($php . ' ' . $cli . '/updates_xml_build.php --path " . escapeshellarg($path) . " --version " . escapeshellarg($streamVersion) . " --stability " . escapeshellarg($stream) . " --gitea-url " . escapeshellarg($giteaUrl) @@ -323,7 +323,7 @@ if (!$dryRun) { } // Sync to all branches - passthru("{$php} {$cli}/updates_xml_sync.php --path " . escapeshellarg($path) + passthru($php . ' ' . $cli . '/updates_xml_sync.php --path " . escapeshellarg($path) . " --current " . escapeshellarg($branch) . " --all" . " --version " . escapeshellarg($releaseVersion) . " --token " . escapeshellarg($token) diff --git a/cli/version_auto_bump.php b/cli/version_auto_bump.php index 9a78e62..a7723b6 100644 --- a/cli/version_auto_bump.php +++ b/cli/version_auto_bump.php @@ -98,14 +98,14 @@ if (!$shouldBump) { // Step 1: Patch bump $bumpOutput = []; -exec("{$php} {$cli}/version_bump.php --path " . escapeshellarg($path) . " 2>&1", $bumpOutput, $bumpRc); +exec($php . ' ' . $cli . '/version_bump.php --path " . escapeshellarg($path) . " 2>&1", $bumpOutput, $bumpRc); foreach ($bumpOutput as $line) { echo "{$line}\n"; } // Step 2: Read version $versionOutput = []; -exec("{$php} {$cli}/version_read.php --path " . escapeshellarg($path) . " 2>&1", $versionOutput, $versionRc); +exec($php . ' ' . $cli . '/version_read.php --path " . escapeshellarg($path) . " 2>&1", $versionOutput, $versionRc); $version = trim($versionOutput[0] ?? ''); if (empty($version)) { @@ -116,7 +116,7 @@ if (empty($version)) { echo "Version: {$version} | Branch: {$branch} | Stability: {$stability}\n"; // Step 3: Set platform version with stability suffix -exec("{$php} {$cli}/version_set_platform.php --path " . escapeshellarg($path) +exec($php . ' ' . $cli . '/version_set_platform.php --path " . escapeshellarg($path) . " --version " . escapeshellarg($version) . " --branch " . escapeshellarg($branch) . " --stability " . escapeshellarg($stability) . " 2>&1", $setPlatOutput); @@ -125,7 +125,7 @@ foreach ($setPlatOutput as $line) { } // Step 4: Version consistency check and fix -exec("{$php} {$cli}/version_check.php --path " . escapeshellarg($path) . " --fix 2>&1", $checkOutput); +exec($php . ' ' . $cli . '/version_check.php --path " . escapeshellarg($path) . " --fix 2>&1", $checkOutput); // Re-read version (now includes suffix from version_set_platform) $suffixMap = [