Skip to content
This repository was archived by the owner on Jul 19, 2025. It is now read-only.

Commit c065aaf

Browse files
committed
chore(benchmark): fix path
1 parent ced7ee6 commit c065aaf

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

scripts/utils.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,22 @@ import fs from 'node:fs'
33
import pico from 'picocolors'
44
import { createRequire } from 'node:module'
55
import { spawn } from 'node:child_process'
6+
import path from 'node:path'
67

78
const require = createRequire(import.meta.url)
9+
const packagesPath = path.resolve(import.meta.dirname, '../packages')
810

911
export const targets = fs
10-
.readdirSync('packages')
12+
.readdirSync(packagesPath)
1113
.filter(f => {
14+
const folder = path.resolve(packagesPath, f)
1215
if (
13-
!fs.statSync(`packages/${f}`).isDirectory() ||
14-
!fs.existsSync(`packages/${f}/package.json`)
16+
!fs.statSync(folder).isDirectory() ||
17+
!fs.existsSync(`${folder}/package.json`)
1518
) {
1619
return false
1720
}
18-
const pkg = require(`../packages/${f}/package.json`)
21+
const pkg = require(`${folder}/package.json`)
1922
if (pkg.private && !pkg.buildOptions) {
2023
return false
2124
}

0 commit comments

Comments
 (0)