Skip to content

Commit

Permalink
Fix error on stat
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewiggins committed Oct 27, 2022
1 parent 631715b commit 9a5c814
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions benches/scripts/prepare.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { readdir, stat } from 'fs/promises';
import { readdir } from 'fs/promises';
import path from 'path';
import { execFileSync } from 'child_process';
import del from 'del';
import { repoRoot } from './utils.js';
import { existsSync } from 'fs';

const npmCmd = process.platform == 'win32' ? 'npm.cmd' : 'npm';

Expand All @@ -25,7 +26,7 @@ export async function prepare(frameworks) {
path.join(proxyRoot, dirname + '-proxy', ...args);

const packageScripts = proxyDir('scripts.mjs');
if ((await stat(packageScripts)).isFile()) {
if (existsSync(packageScripts)) {
await import(packageScripts).then(m => m.preinstall());
}

Expand Down

0 comments on commit 9a5c814

Please sign in to comment.