Skip to content

Commit b351d57

Browse files
Steven4857洪伟
andauthored
fix: regex typo (#171)
Co-authored-by: 洪伟 <hongw@meixing.com>
1 parent 1649fe5 commit b351d57

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export async function getConfig(): Promise<Config> {
3434
let packageManager = ''
3535
if (result)
3636
packageManager = JSON.parse(fs.readFileSync(result, 'utf8')).packageManager ?? ''
37-
const [, agent, version] = packageManager.match(new RegExp(`^(${Object.values(LOCKS).join('|')})@(\d).*?$`)) || []
37+
const [, agent, version] = packageManager.match(new RegExp(`^(${Object.values(LOCKS).join('|')})@(\\d).*?$`)) || []
3838
if (agent)
3939
config = Object.assign({}, defaultConfig, { defaultAgent: (agent === 'yarn' && Number.parseInt(version) > 1) ? 'yarn@berry' : agent })
4040
else if (!fs.existsSync(rcPath))

0 commit comments

Comments
 (0)