Skip to content

Commit 7420148

Browse files
committed
fix path thingy
1 parent afa64d5 commit 7420148

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

dev-packages/node-overhead-gh-action/lib/getOverheadMeasurements.mjs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
import { spawn } from 'child_process';
2-
import { join } from 'path';
2+
import { dirname, join } from 'path';
3+
import { fileURLToPath } from 'url';
34

45
const DEBUG = !!process.env.DEBUG;
56

7+
const __dirname = dirname(fileURLToPath(import.meta.url));
8+
69
async function getMeasurements(instrumentFile) {
7-
const curPath = process.cwd();
8-
const args = [join(curPath, './src/app.mjs')];
10+
const args = [join(__dirname, '../src/app.mjs')];
911

1012
if (instrumentFile) {
11-
args.unshift('--import', join(curPath, instrumentFile));
13+
args.unshift('--import', join(__dirname, '..', instrumentFile));
1214
}
1315

1416
const cmd = `node ${args.join(' ')}`;

0 commit comments

Comments
 (0)