Skip to content

Commit

Permalink
fix: πŸ› stricter regex for known binaries
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Mar 16, 2020
1 parent cfcddf4 commit 5d5fc92
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/process-list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ async function parseCommand(proc: ProcessListInfo): Promise<ProcessInfo> {
ret.argv = ret.argv.map(arg => arg.replace(/.*node_modules\//u, ""))

// Replace common binaries
const runners = ["npx", "npm"]
runners.forEach(r => {
if (new RegExp(`${r}(.[tj]s)?$`, "u").test(ret.argv[0])) ret.argv[0] = r
const knownBins = ["npx", "npm"]
knownBins.forEach(r => {
if (new RegExp(`/${r}(.[tj]s)?$`, "u").test(ret.argv[0])) ret.argv[0] = r
})

ret.argv[0] = ret.argv[0].replace(/^\.bin\//u, "")
Expand Down

0 comments on commit 5d5fc92

Please sign in to comment.