From fc35f0dc4f78afc1c631fa94b6ac85ba0fb0e7b1 Mon Sep 17 00:00:00 2001 From: Bret Comnes Date: Wed, 3 Jul 2024 20:23:10 -0700 Subject: [PATCH] Revert "Compatibility: npm, yarn and pnpm run scripts" This reverts commit b8d3dedbe2ec3c50228054f8cf7e371d2e364303. --- lib/index.js | 25 ++----------------------- 1 file changed, 2 insertions(+), 23 deletions(-) diff --git a/lib/index.js b/lib/index.js index f0ea4e0..c35c034 100644 --- a/lib/index.js +++ b/lib/index.js @@ -112,29 +112,8 @@ function applyArguments (patterns, args) { * @returns {string[]} Parsed patterns. */ function parsePatterns (patternOrPatterns, args) { - let patterns = toArray(patternOrPatterns) - - const isNPM = process.env.npm_config_user_agent && process.env.npm_config_user_agent.startsWith('npm') - - if (!isNPM) { - // yarn | pnpm - patterns = patterns.map((pattern) => { - const match = ARGS_PATTERN.exec(pattern) - - if (!match) { - return pattern - } - - const patternList = pattern.split(' ') - const doubleDashIndex = patternList.findIndex((item) => item === '--') - patternList.splice(doubleDashIndex, 1) - pattern = patternList.join(' ') - - return pattern - }) - } - - const hasPlaceholder = patterns.some((pattern) => ARGS_PATTERN.test(pattern)) + const patterns = toArray(patternOrPatterns) + const hasPlaceholder = patterns.some(pattern => ARGS_PATTERN.test(pattern)) return hasPlaceholder ? applyArguments(patterns, args) : patterns }