Skip to content

Commit 612fd34

Browse files
committed
Use whichBin from registry
1 parent 20a5304 commit 612fd34

4 files changed

Lines changed: 4 additions & 10 deletions

File tree

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,6 @@
179179
"typescript-eslint": "8.43.0",
180180
"unplugin-purge-polyfills": "0.1.0",
181181
"vitest": "3.2.4",
182-
"which": "5.0.0",
183182
"yaml": "2.8.1",
184183
"yargs-parser": "22.0.0",
185184
"yoctocolors-cjs": "2.1.3",

pnpm-lock.yaml

Lines changed: 0 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/utils/package-environment.mts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ import path from 'node:path'
33

44
import browserslist from 'browserslist'
55
import semver from 'semver'
6-
import which from 'which'
76

87
import { parse as parseBunLockb } from '@socketregistry/hyrious__bun.lockb/index.cjs'
8+
import { whichBin } from '@socketsecurity/registry/lib/bin'
99
import { debugDir, debugFn } from '@socketsecurity/registry/lib/debug'
1010
import { readFileBinary, readFileUtf8 } from '@socketsecurity/registry/lib/fs'
1111
import { Logger } from '@socketsecurity/registry/lib/logger'
@@ -210,7 +210,7 @@ async function getAgentExecPath(agent: Agent): Promise<string> {
210210
if (binName === NPM) {
211211
return constants.npmExecPath
212212
}
213-
return (await which(binName, { nothrow: true })) ?? binName
213+
return (await whichBin(binName, { nothrow: true })) ?? binName
214214
}
215215

216216
async function getAgentVersion(

src/utils/path-resolve.mts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
import { existsSync } from 'node:fs'
22
import path from 'node:path'
33

4-
import which from 'which'
5-
6-
import { resolveBinPathSync } from '@socketsecurity/registry/lib/agent'
4+
import { resolveBinPathSync, whichBinSync } from '@socketsecurity/registry/lib/bin'
75
import { isDirSync } from '@socketsecurity/registry/lib/fs'
86

97
import constants, { NODE_MODULES, NPM } from '../constants.mts'
@@ -22,7 +20,7 @@ export function findBinPathDetailsSync(binName: string): {
2220
shadowed: boolean
2321
} {
2422
const binPaths =
25-
which.sync(binName, {
23+
whichBinSync(binName, {
2624
all: true,
2725
nothrow: true,
2826
}) ?? []

0 commit comments

Comments
 (0)