From 34e5571fea037eacf19467149f1b1a0aa2d6f224 Mon Sep 17 00:00:00 2001 From: Vladimir Bryzgalov Date: Tue, 21 Apr 2026 21:21:06 +0500 Subject: [PATCH] fix(release): replace \s with [[:space:]] in bump sed (BSD compat) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Critical: macOS BSD sed does not support \s character class. The two substitutions in the version-bump step silently no-oped, the grep fail-fast guard caught it (no remote damage), but release.sh couldn't complete. Using POSIX [[:space:]] works on both BSD and GNU sed. Also: extend test_git_archive_excludes_dev_files to cover .phpunit.result.cache, .beads/, .claude/, dist/, .DS_Store — the test now fully enforces .gitattributes export-ignore invariant. --- release.sh | 4 ++-- tests/ZipArchiveBuildTest.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/release.sh b/release.sh index 29fe758..0afcd41 100755 --- a/release.sh +++ b/release.sh @@ -76,8 +76,8 @@ log "Validation passed: version=$VERSION, tag=$TAG, branch=$BRANCH" log "Bumping version to $VERSION in cf7-spam-to-telegram.php and readme.txt" sed -i.bak -E \ - -e "s|^(\\s*\\*\\s*Version:\\s*).*$|\\1${VERSION}|" \ - -e "s|define\\('CF7STG_VERSION',\\s*'[^']+'\\)|define('CF7STG_VERSION', '${VERSION}')|" \ + -e "s|^([[:space:]]*\\*[[:space:]]*Version:[[:space:]]*).*$|\\1${VERSION}|" \ + -e "s|define\\('CF7STG_VERSION',[[:space:]]*'[^']+'\\)|define('CF7STG_VERSION', '${VERSION}')|" \ cf7-spam-to-telegram.php rm cf7-spam-to-telegram.php.bak diff --git a/tests/ZipArchiveBuildTest.php b/tests/ZipArchiveBuildTest.php index 6cb4095..3e7ad16 100644 --- a/tests/ZipArchiveBuildTest.php +++ b/tests/ZipArchiveBuildTest.php @@ -52,7 +52,7 @@ final class ZipArchiveBuildTest extends Cf7stgTestCase $entries = self::listZip($zip); $joined = implode("\n", $entries); - foreach (['tests/', 'docs/', 'composer.json', 'composer.lock', 'phpunit.xml', 'release.sh', '.gitattributes', '.gitignore', 'CLAUDE.md', 'AGENTS.md'] as $devPath) { + foreach (['tests/', 'docs/', 'composer.json', 'composer.lock', 'phpunit.xml', 'release.sh', '.gitattributes', '.gitignore', 'CLAUDE.md', 'AGENTS.md', '.phpunit.result.cache', '.beads/', '.claude/', 'dist/', '.DS_Store'] as $devPath) { self::assertStringNotContainsString( "cf7-spam-to-telegram/$devPath", $joined,