Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
nvuillam committed Dec 19, 2024
1 parent 898d707 commit b3ba526
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
3 changes: 0 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ ENV PUPPETEER_EXECUTABLE_PATH="${CHROMIUM_PATH}"
# hadolint ignore=DL3044
ENV PATH="/node_modules/.bin:${PATH}"

RUN adduser -D sfdxhardis
USER sfdxhardis

ARG SFDX_CLI_VERSION=latest
ARG SFDX_HARDIS_VERSION=latest

Expand Down
6 changes: 6 additions & 0 deletions defaults/puppeteer-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"args": [
"--no-sandbox",
"--disable-setuid-sandbox"
]
}
4 changes: 3 additions & 1 deletion src/common/utils/mermaidUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { parseFlow } from "./flowVisualiser/flowParser.js";
import { getReportDirectory } from "../../config/index.js";
import moment from "moment";
import { SfError } from "@salesforce/core";
import { PACKAGE_ROOT_DIR } from "../../settings.js";


let IS_MERMAID_AVAILABLE: boolean | null = null;
Expand Down Expand Up @@ -40,7 +41,8 @@ export async function generateFlowMarkdownFile(flowName: string, flowXml: string
export async function generateMarkdownFileWithMermaid(outputFlowMdFile: string): Promise<boolean> {
const isMmdAvailable = await isMermaidAvailable();
uxLog(this, c.grey(`Generating mermaidJs Graphs in ${outputFlowMdFile}...`));
const mermaidCmd = `${!isMmdAvailable ? 'npx --yes -p @mermaid-js/mermaid-cli ' : ''}mmdc -i "${outputFlowMdFile}" -o "${outputFlowMdFile}" --puppeteer-config '{"args": ["--no-sandbox", "--disable-setuid-sandbox"]}'`;
const puppeteerConfigPath = path.join(PACKAGE_ROOT_DIR, 'defaults', 'puppeteer-config.json');
const mermaidCmd = `${!isMmdAvailable ? 'npx --yes -p @mermaid-js/mermaid-cli ' : ''}mmdc -i "${outputFlowMdFile}" -o "${outputFlowMdFile}" --puppeteerConfigFile "${puppeteerConfigPath}"`;
try {
await execCommand(mermaidCmd, this, { output: false, fail: true, debug: false });
return true;
Expand Down

0 comments on commit b3ba526

Please sign in to comment.