From b2d0ef9c257eca87d292341bea77f2b676cb75b7 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 30 Jun 2026 17:14:51 +0000 Subject: [PATCH] fix: restore file content extraction and release v4.2.1 The v4.2 release was flagged "DON'T USE, IT WON'T WORK": the extraction pipeline produced an output file containing only the directory tree, with every file wrongly reported as empty ("Processed 0 files"). The working extraction logic is already on main; this bumps the version so a fixed release can be published. - Bump version to 4.2.1 in header, main() banner and package.json - Document the regression fixes in CHANGELOG.md Co-Authored-By: Claude Opus 4.8 Claude-Session: https://claude.ai/code/session_01Y2XJw3TXS1EuWdgmnGD4ts --- CHANGELOG.md | 18 ++++++++++++++++++ codepack.sh | 4 ++-- package.json | 2 +- 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 53c72e0..909f898 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,24 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [4.2.1] - 2026-06-30 + +### Fixed +- **Critical regression**: file contents were no longer extracted — the output + contained only the directory tree and every file was wrongly reported as + "empty" (`Processed 0 files`). The content extraction pipeline now reads and + writes file contents correctly again. +- `should_process_file()`: extension matching now strips a leading dot + (e.g. `--include .py` and `--include py` behave identically) and files without + an extension are handled correctly in both include and exclude modes. +- `list_files_to_process()`: rebuilt around a single `find` invocation with + proper directory, filename and extension filtering, emitting NUL-delimited + paths so filenames with spaces are handled safely. +- Removed a stray control character from the content-reading `sed` pipeline that + could corrupt or blank out file contents. +- Replaced `mapfile` with a Bash 3.2-compatible read loop so the script runs on + macOS's default Bash. + ## [4.2] - 2025-12-18 ### Added diff --git a/codepack.sh b/codepack.sh index 74eff8a..d7e0bae 100755 --- a/codepack.sh +++ b/codepack.sh @@ -4,7 +4,7 @@ # Author: Ɛɔıs3 Solutions # GitHub: https://github.com/w3spi5 # License: MIT -# Version: 4.2 +# Version: 4.2.1 # Dependencies: Optional external minifiers for maximum compression # ---------------------------------------------------------------------------- @@ -935,7 +935,7 @@ main() { check_minifiers echo "" - echo "🔧 codepack v4.2" + echo "🔧 codepack v4.2.1" echo "Automatically excluding directories: $(printf "'%s', " "${exclude_dirs[@]}" | sed 's/, $//')" echo "Automatically excluding files: $(printf "'%s', " "${exclude_files[@]}" | sed 's/, $//')" diff --git a/package.json b/package.json index 885b366..ef4c1a6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@w3spi5/codepack", - "version": "4.2.0", + "version": "4.2.1", "keywords": [ "cli", "minify",