agileflow 2.96.2 → 2.96.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
CHANGED
package/package.json
CHANGED
|
@@ -269,9 +269,10 @@ class BaseIdeSetup {
|
|
|
269
269
|
* Scan a directory for files with a specific extension
|
|
270
270
|
* @param {string} dirPath - Directory path
|
|
271
271
|
* @param {string} extension - File extension (e.g., '.md')
|
|
272
|
-
* @
|
|
272
|
+
* @param {string} [prefix=''] - Prefix for nested names (used for recursion)
|
|
273
|
+
* @returns {Promise<Array>} List of files with name, path, filename
|
|
273
274
|
*/
|
|
274
|
-
async scanDirectory(dirPath, extension) {
|
|
275
|
+
async scanDirectory(dirPath, extension, prefix = '') {
|
|
275
276
|
const results = [];
|
|
276
277
|
|
|
277
278
|
if (!(await this.exists(dirPath))) {
|
|
@@ -281,12 +282,23 @@ class BaseIdeSetup {
|
|
|
281
282
|
const entries = await fs.readdir(dirPath, { withFileTypes: true });
|
|
282
283
|
|
|
283
284
|
for (const entry of entries) {
|
|
285
|
+
const fullPath = path.join(dirPath, entry.name);
|
|
286
|
+
|
|
284
287
|
if (entry.isFile() && entry.name.endsWith(extension)) {
|
|
288
|
+
// Build name with prefix for subcommands (e.g., ideate-new from ideate/new.md)
|
|
289
|
+
const baseName = entry.name.replace(extension, '');
|
|
290
|
+
const fullName = prefix ? `${prefix}-${baseName}` : baseName;
|
|
291
|
+
|
|
285
292
|
results.push({
|
|
286
|
-
name:
|
|
287
|
-
path:
|
|
293
|
+
name: fullName,
|
|
294
|
+
path: fullPath,
|
|
288
295
|
filename: entry.name,
|
|
289
296
|
});
|
|
297
|
+
} else if (entry.isDirectory()) {
|
|
298
|
+
// Recursively scan subdirectories with prefix
|
|
299
|
+
const subPrefix = prefix ? `${prefix}-${entry.name}` : entry.name;
|
|
300
|
+
const subResults = await this.scanDirectory(fullPath, extension, subPrefix);
|
|
301
|
+
results.push(...subResults);
|
|
290
302
|
}
|
|
291
303
|
}
|
|
292
304
|
|