make-folder-txt 1.3.1 → 1.3.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.
@@ -81,8 +81,11 @@ function collectFiles(
81
81
  return;
82
82
  }
83
83
 
84
- // Check against .txtignore patterns
85
- if (txtIgnore.has(entry.name) || txtIgnore.has(`${entry.name}/`)) {
84
+ // Get relative path for .txtignore pattern matching
85
+ const relPathForIgnore = path.relative(rootDir, path.join(dir, entry.name)).split(path.sep).join("/");
86
+
87
+ // Check against .txtignore patterns (both dirname and relative path)
88
+ if (txtIgnore.has(entry.name) || txtIgnore.has(`${entry.name}/`) || txtIgnore.has(relPathForIgnore) || txtIgnore.has(`${relPathForIgnore}/`) || txtIgnore.has(`/${relPathForIgnore}/`)) {
86
89
  if (!hasOnlyFilters) {
87
90
  lines.push(`${indent}${connector}${entry.name}/ [skipped]`);
88
91
  }
@@ -122,8 +125,11 @@ function collectFiles(
122
125
  } else {
123
126
  if (ignoreFiles.has(entry.name)) return;
124
127
 
125
- // Check against .txtignore patterns
126
- if (txtIgnore.has(entry.name)) {
128
+ // Get relative path for .txtignore pattern matching
129
+ const relPathForIgnore = path.relative(rootDir, path.join(dir, entry.name)).split(path.sep).join("/");
130
+
131
+ // Check against .txtignore patterns (both filename and relative path)
132
+ if (txtIgnore.has(entry.name) || txtIgnore.has(relPathForIgnore) || txtIgnore.has(`/${relPathForIgnore}`)) {
127
133
  return;
128
134
  }
129
135
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "make-folder-txt",
3
- "version": "1.3.1",
3
+ "version": "1.3.3",
4
4
  "description": "Generate a single .txt file containing the full folder structure and file contents of any project, ignoring node_modules and other junk.",
5
5
  "main": "bin/make-folder-txt.js",
6
6
  "bin": {