| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent d76e16b commit 4be33b5
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,6 +1,7 @@ | |||
| 1 | 1 | 'use strict'; | |
| 2 | 2 | const common = require('../common.js'); | |
| 3 | 3 | const { spawnSync } = require('child_process'); | |
| 4 | + const { existsSync } = require('fs'); | ||
| 4 | 5 | const path = require('path'); | |
| 5 | 6 | ||
| 6 | 7 | // This benchmarks the startup of various CLI tools that are already | |
@@ -11,6 +12,7 @@ const path = require('path'); | |||
| 11 | 12 | const bench = common.createBenchmark(main, { | |
| 12 | 13 | cli: [ | |
| 13 | 14 | 'tools/node_modules/eslint/bin/eslint.js', | |
| 15 | + 'deps/npm/bin/npx-cli.js', | ||
| 14 | 16 | 'deps/npm/bin/npm-cli.js', | |
| 15 | 17 | 'deps/corepack/dist/corepack.js', | |
| 16 | 18 | ], | |
@@ -45,6 +47,10 @@ function spawnProcess(cli, bench, state) { | |||
| 45 | 47 | ||
| 46 | 48 | function main({ count, cli }) { | |
| 47 | 49 | cli = path.resolve(__dirname, '../../', cli); | |
| 50 | + if (!existsSync(cli)) { | ||
| 51 | + return; | ||
| 52 | + } | ||
| 53 | + | ||
| 48 | 54 | const warmup = 3; | |
| 49 | 55 | const state = { count, finished: -warmup }; | |
| 50 | 56 | spawnProcess(cli, bench, state); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments