fix: batch directory creation log messages for cleaner installer output
Collect all created directory names during module directory setup and emit them as a single log message instead of one per directory. This eliminates the excessive blank-line spacing that @clack/prompts adds between individual log.message() calls. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
9c3e9f682b
commit
c83b4f6391
|
|
@ -1290,6 +1290,8 @@ class ModuleManager {
|
||||||
const color = await prompts.getColor();
|
const color = await prompts.getColor();
|
||||||
const directories = moduleYaml.directories;
|
const directories = moduleYaml.directories;
|
||||||
const wdsFolders = moduleYaml.wds_folders || [];
|
const wdsFolders = moduleYaml.wds_folders || [];
|
||||||
|
const createdDirs = [];
|
||||||
|
const createdWdsFolders = [];
|
||||||
|
|
||||||
for (const dirRef of directories) {
|
for (const dirRef of directories) {
|
||||||
// Parse variable reference like "{design_artifacts}"
|
// Parse variable reference like "{design_artifacts}"
|
||||||
|
|
@ -1325,22 +1327,31 @@ class ModuleManager {
|
||||||
// Create directory if it doesn't exist
|
// Create directory if it doesn't exist
|
||||||
if (!(await fs.pathExists(fullPath))) {
|
if (!(await fs.pathExists(fullPath))) {
|
||||||
const dirName = configKey.replaceAll('_', ' ');
|
const dirName = configKey.replaceAll('_', ' ');
|
||||||
await prompts.log.message(color.yellow(`Creating ${dirName} directory: ${dirPath}`));
|
createdDirs.push(`${dirName}: ${dirPath}`);
|
||||||
await fs.ensureDir(fullPath);
|
await fs.ensureDir(fullPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create WDS subfolders if this is the design_artifacts directory
|
// Create WDS subfolders if this is the design_artifacts directory
|
||||||
if (configKey === 'design_artifacts' && wdsFolders.length > 0) {
|
if (configKey === 'design_artifacts' && wdsFolders.length > 0) {
|
||||||
await prompts.log.message(color.cyan('Creating WDS folder structure...'));
|
|
||||||
for (const subfolder of wdsFolders) {
|
for (const subfolder of wdsFolders) {
|
||||||
const subPath = path.join(fullPath, subfolder);
|
const subPath = path.join(fullPath, subfolder);
|
||||||
if (!(await fs.pathExists(subPath))) {
|
if (!(await fs.pathExists(subPath))) {
|
||||||
await fs.ensureDir(subPath);
|
await fs.ensureDir(subPath);
|
||||||
await prompts.log.message(color.dim(` ✓ ${subfolder}/`));
|
createdWdsFolders.push(subfolder);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Batch output: single log message for all created directories
|
||||||
|
if (createdDirs.length > 0) {
|
||||||
|
const lines = createdDirs.map((d) => ` ${d}`).join('\n');
|
||||||
|
await prompts.log.message(color.yellow(`Created directories:\n${lines}`));
|
||||||
|
}
|
||||||
|
if (createdWdsFolders.length > 0) {
|
||||||
|
const lines = createdWdsFolders.map((f) => color.dim(` ✓ ${f}/`)).join('\n');
|
||||||
|
await prompts.log.message(color.cyan(`Created WDS folder structure:\n${lines}`));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue