Skip to content

Commit

Permalink
fix: Default puppeteer-config to not set executable path unless OS is… (
Browse files Browse the repository at this point in the history
#235)

* fix: Default puppeteer-config to not set executable path unless OS is anything but Windows

* attempt to remove setting default executable path to troubleshoot mac os test failure in github actions

* .

* cross-env use for windows
  • Loading branch information
keonik committed Aug 17, 2023
1 parent 7d3b9a5 commit d4e99f0
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 2 deletions.
2 changes: 1 addition & 1 deletion __tests__/disabled-env.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ test('disabled-env.prisma', async () => {
const folderName = '__tests__';
child_process.execSync(`rm -f ${folderName}/${fileName}`);
child_process.execSync(
`npx cross-env DISABLE_ERD=true prisma generate --schema ./prisma/disabled-env.prisma`
`cross-env DISABLE_ERD=true prisma generate --schema ./prisma/disabled-env.prisma`
);
const exists = fs.existsSync(`${folderName}/${fileName}`);
expect(exists).toBe(false);
Expand Down
19 changes: 19 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@
"all-contributors-cli": "^6.26.1",
"babel-jest": "^29.6.2",
"concurrently": "^8.2.0",
"cross-env": "^7.0.3",
"jest": "^29.6.2",
"mermaid": "^10.3.0",
"prettier": "3.0.1",
Expand Down
3 changes: 2 additions & 1 deletion src/generate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ export default async (options: GeneratorOptions) => {
const tempPuppeteerConfigFile = path.resolve(
path.join(tmpDir, 'puppeteerConfig.json')
);
const executablePath = '/usr/bin/chromium-browser';
let executablePath: string | undefined;
let puppeteerConfigJson: PuppeteerConfiguration & {
args: string[];
} = {
Expand All @@ -468,6 +468,7 @@ export default async (options: GeneratorOptions) => {
console.log(
`\nPrisma ERD Generator: Unable to find chromium path for you MacOS arm64 machine. Attempting to use the default at ${executablePath}. To learn more visit https://github.com/keonik/prisma-erd-generator#-arm64-users-\n`
);
executablePath = '/usr/bin/chromium-browser';
}
}
fs.writeFileSync(
Expand Down

0 comments on commit d4e99f0

Please sign in to comment.