combicode 1.5.2 → 1.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/index.js +8 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.5.3](https://github.com/aaurelions/combicode/compare/combicode-js-v1.5.2...combicode-js-v1.5.3) (2025-11-30)
|
|
4
|
+
|
|
5
|
+
### Bug Fixes
|
|
6
|
+
|
|
7
|
+
- **cli:** prevent the output file (e.g., `combicode.txt`) from recursively including itself in the generated content
|
|
8
|
+
|
|
3
9
|
## [1.5.2](https://github.com/aaurelions/combicode/compare/combicode-js-v1.4.0...combicode-js-v1.5.2) (2025-11-30)
|
|
4
10
|
|
|
5
11
|
### Features
|
package/index.js
CHANGED
|
@@ -181,6 +181,9 @@ async function main() {
|
|
|
181
181
|
ignorePatterns.push(...argv.exclude.split(","));
|
|
182
182
|
}
|
|
183
183
|
|
|
184
|
+
// Calculate the absolute path of the output file to prevent self-inclusion
|
|
185
|
+
const absoluteOutputPath = path.resolve(projectRoot, argv.output);
|
|
186
|
+
|
|
184
187
|
let allFiles = await glob("**/*", {
|
|
185
188
|
cwd: projectRoot,
|
|
186
189
|
dot: true,
|
|
@@ -200,6 +203,11 @@ async function main() {
|
|
|
200
203
|
const includedFiles = allFiles
|
|
201
204
|
.filter((fileObj) => {
|
|
202
205
|
const file = fileObj.path;
|
|
206
|
+
|
|
207
|
+
// Prevent the output file from being included in the list
|
|
208
|
+
// We use path.normalize to handle potential differences in separators (e.g., / vs \)
|
|
209
|
+
if (path.normalize(file) === absoluteOutputPath) return false;
|
|
210
|
+
|
|
203
211
|
if (!fileObj.stats || fileObj.stats.isDirectory()) return false;
|
|
204
212
|
if (isLikelyBinary(file)) return false;
|
|
205
213
|
if (allowedExtensions && !allowedExtensions.has(path.extname(file)))
|