combicode 1.7.3 → 1.7.4
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/index.js +24 -0
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -288,6 +288,30 @@ async function main() {
|
|
|
288
288
|
rootIgnoreManager.add(argv.exclude.split(","));
|
|
289
289
|
}
|
|
290
290
|
|
|
291
|
+
const gitModulesPath = path.join(projectRoot, ".gitmodules");
|
|
292
|
+
if (fs.existsSync(gitModulesPath)) {
|
|
293
|
+
try {
|
|
294
|
+
const content = fs.readFileSync(gitModulesPath, "utf8");
|
|
295
|
+
const lines = content.split(/\r?\n/);
|
|
296
|
+
const submodulePaths = [];
|
|
297
|
+
|
|
298
|
+
for (const line of lines) {
|
|
299
|
+
// Match lines like: path = libs/my-lib
|
|
300
|
+
const match = line.match(/^\s*path\s*=\s*(.+?)\s*$/);
|
|
301
|
+
if (match) {
|
|
302
|
+
submodulePaths.push(match[1]);
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
if (submodulePaths.length > 0) {
|
|
307
|
+
// Add identified submodule paths to the ignore manager
|
|
308
|
+
rootIgnoreManager.add(submodulePaths);
|
|
309
|
+
}
|
|
310
|
+
} catch {
|
|
311
|
+
// Fail silently if .gitmodules cannot be read
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
|
|
291
315
|
// Create skip-content manager
|
|
292
316
|
const skipContentManager = ignore();
|
|
293
317
|
if (argv.skipContent) {
|