Skip to content

Commit

Permalink
fallbacks
Browse files Browse the repository at this point in the history
  • Loading branch information
nvuillam committed Dec 22, 2024
1 parent c20d06a commit 35779ec
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/common/utils/mermaidUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,14 @@ export async function generateMarkdownFileWithMermaid(outputFlowMdFile: string):
return true;
} catch (e: any) {
uxLog(this, c.yellow(`Error generating mermaidJs Graphs in ${outputFlowMdFile} documentation with Docker: ${e.message}`) + "\n" + c.grey(e.stack));
if (JSON.stringify(e).includes("Cannot connect to the Docker daemon")) {
process.env.MERMAID_USE_DOCKER = "false";
return await generateMarkdownFileWithMermaid(outputFlowMdFile);
}
return false;
}
}
else {
else if (!(globalThis?.tryMermaidWithDocker === true)) {
// Try with NPM package
const isMmdAvailable = await isMermaidAvailable();
uxLog(this, c.grey(`Generating mermaidJs Graphs in ${outputFlowMdFile}...`));
Expand All @@ -86,6 +90,10 @@ export async function generateMarkdownFileWithMermaid(outputFlowMdFile: string):
return false;
}
}
else {
uxLog(this, c.yellow("Either mermaid-cli or docker is required to work to generate mermaidJs Graphs. Please install/fix one of them if you want to generate SVG diagrams."));
return false;
}
}

export function getMermaidExtraClasses() {
Expand Down

0 comments on commit 35779ec

Please sign in to comment.