From a4cc2a0e30b5bb667900aac021514a32e8c9f1ac Mon Sep 17 00:00:00 2001 From: Anton Golub Date: Wed, 25 Dec 2024 23:00:18 +0300 Subject: [PATCH] chore: fix quote regexp (#1040) --- src/util.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/util.ts b/src/util.ts index 1c42eaf4d5..ca5cb47b51 100644 --- a/src/util.ts +++ b/src/util.ts @@ -101,7 +101,7 @@ export function preferLocalBin( // } export function quote(arg: string): string { - if (/^[\w/.-@:=]+$/.test(arg) || arg === '') { + if (/^[\w/.\-@:=]+$/.test(arg) || arg === '') { return arg } return ( @@ -120,7 +120,7 @@ export function quote(arg: string): string { } export function quotePowerShell(arg: string): string { - if (/^[\w/.-]+$/.test(arg) || arg === '') { + if (/^[\w/.\-]+$/.test(arg) || arg === '') { return arg } return `'` + arg.replace(/'/g, "''") + `'`