Skip to content

Commit

Permalink
Use verbose only if debugmode + index flow table
Browse files Browse the repository at this point in the history
  • Loading branch information
nvuillam committed Dec 22, 2024
1 parent 21a1e2c commit 9157c4f
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 11 deletions.
26 changes: 18 additions & 8 deletions src/commands/hardis/doc/project2markdown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,24 +166,34 @@ Run \`npm install @mermaid-js/mermaid-cli --global\`
uxLog(this, c.yellow(`Error generating documentation for ${flowErrors.length} Flows: ${flowErrors.join(", ")}`));
}

await this.writeFlowsTable(flowDescriptions);
// Write table on doc index
const flowTableLines = await this.buildFlowsTable(flowDescriptions, 'flows/');
this.mdLines.push(...flowTableLines);
this.mdLines.push(...["___", ""])

// Write index file for flow folder
await fs.ensureDir(path.join(this.outputMarkdownRoot, "flows"));
const flowTableLinesForIndex = await this.buildFlowsTable(flowDescriptions, '');
const flowIndexFile = path.join(this.outputMarkdownRoot, "flows", "index.md");
await fs.writeFile(flowIndexFile, flowTableLinesForIndex.join("\n") + "\n");
uxLog(this, c.green(`Successfully generated doc index for Flows at ${flowIndexFile}`));
}

private async writeFlowsTable(flowDescriptions: any[]) {
this.mdLines.push(...[
private async buildFlowsTable(flowDescriptions: any[], prefix: string) {
const lines: string[] = [];
lines.push(...[
"## Flows",
"",
"| Object | Name | Type | Description |",
"| :---- | :-------- | :--: | :---------- | "
]);
for (const flow of sortArray(flowDescriptions, { by: ['object', 'name'], order: ['asc', 'asc'] }) as any[]) {
this.mdLines.push(...[
`| ${flow.object} | [${flow.name}](flows/${flow.name}.md) | ${flow.type} | ${flow.description} |`
lines.push(...[
`| ${flow.object} | [${flow.name}](${prefix}${flow.name}.md) | ${flow.type} | ${flow.description} |`
]);
}
this.mdLines.push("");
this.mdLines.push("___");
this.mdLines.push("");
lines.push("");
return lines;
}

private async writeInstalledPackages() {
Expand Down
6 changes: 3 additions & 3 deletions src/common/utils/deployUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ export async function smartDeploy(
` --job-id ${deploymentCheckId} ` +
(options.targetUsername ? ` -o ${options.targetUsername}` : '') +
` --wait ${process.env.SFDX_DEPLOY_WAIT_MINUTES || '120'}` +
` --verbose` +
(debugMode ? ' --verbose' : '') +
(process.env.SFDX_DEPLOY_DEV_DEBUG ? ' --dev-debug' : '');
const quickDeployRes = await execSfdxJson(quickDeployCommand, commandThis, {
output: true,
Expand Down Expand Up @@ -281,7 +281,7 @@ export async function smartDeploy(
(options.postDestructiveChanges ? ` --post-destructive-changes ${options.postDestructiveChanges}` : '') +
(options.targetUsername ? ` -o ${options.targetUsername}` : '') +
(testlevel === 'NoTestRun' || branchConfig?.skipCodeCoverage === true ? '' : ' --coverage-formatters json-summary') +
' --verbose' +
(debugMode ? ' --verbose' : '') +
` --wait ${process.env.SFDX_DEPLOY_WAIT_MINUTES || '120'}` +
(process.env.SFDX_DEPLOY_DEV_DEBUG ? ' --dev-debug' : '') +
` --json`;
Expand Down Expand Up @@ -835,7 +835,7 @@ export async function deployMetadatas(
` --test-level ${options.testlevel || 'RunLocalTests'}` +
` --api-version ${options.apiVersion || CONSTANTS.API_VERSION}` +
(options.targetUsername ? ` --target-org ${options.targetUsername}` : '') +
' --verbose' +
(options.debug ? ' --verbose' : '') +
' --json';
let deployRes;
try {
Expand Down

0 comments on commit 9157c4f

Please sign in to comment.