Commit a4cc2a0

Anton Golub <antongolub@antongolub.com>
2024-12-25 21:00:18
chore: fix quote regexp (#1040)
1 parent f30a9d0
Changed files (1)
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, "''") + `'`