Skip to content

Commit fc35f0d

Browse files
committedJul 4, 2024··
Revert "Compatibility: npm, yarn and pnpm run scripts"
This reverts commit b8d3ded.
1 parent c707195 commit fc35f0d

File tree

1 file changed

+2
-23
lines changed

1 file changed

+2
-23
lines changed
 

‎lib/index.js

+2-23
Original file line numberDiff line numberDiff line change
@@ -112,29 +112,8 @@ function applyArguments (patterns, args) {
112112
* @returns {string[]} Parsed patterns.
113113
*/
114114
function parsePatterns (patternOrPatterns, args) {
115-
let patterns = toArray(patternOrPatterns)
116-
117-
const isNPM = process.env.npm_config_user_agent && process.env.npm_config_user_agent.startsWith('npm')
118-
119-
if (!isNPM) {
120-
// yarn | pnpm
121-
patterns = patterns.map((pattern) => {
122-
const match = ARGS_PATTERN.exec(pattern)
123-
124-
if (!match) {
125-
return pattern
126-
}
127-
128-
const patternList = pattern.split(' ')
129-
const doubleDashIndex = patternList.findIndex((item) => item === '--')
130-
patternList.splice(doubleDashIndex, 1)
131-
pattern = patternList.join(' ')
132-
133-
return pattern
134-
})
135-
}
136-
137-
const hasPlaceholder = patterns.some((pattern) => ARGS_PATTERN.test(pattern))
115+
const patterns = toArray(patternOrPatterns)
116+
const hasPlaceholder = patterns.some(pattern => ARGS_PATTERN.test(pattern))
138117

139118
return hasPlaceholder ? applyArguments(patterns, args) : patterns
140119
}

0 commit comments

Comments
 (0)
Please sign in to comment.