Comparing version 7.1.0-dev.cfa0fba to 7.1.0
@@ -20,3 +20,3 @@ // Copyright 2021 Google LLC | ||
import which from 'which'; | ||
import { errnoMessage, exitCodeInfo, formatCmd, noop, parseDuration, psTree, quote, } from './util.js'; | ||
import { errnoMessage, exitCodeInfo, formatCmd, noop, parseDuration, psTree, quote, quotePowerShell, } from './util.js'; | ||
const processCwd = Symbol('processCwd'); | ||
@@ -46,3 +46,4 @@ const storage = new AsyncLocalStorage(); | ||
if (process.platform == 'win32') { | ||
defaults.shell = true; | ||
defaults.shell = which.sync('powershell.exe'); | ||
defaults.quote = quotePowerShell; | ||
} | ||
@@ -49,0 +50,0 @@ else { |
@@ -7,2 +7,3 @@ import psTreeModule from 'ps-tree'; | ||
export declare function quote(arg: string): string; | ||
export declare function quotePowerShell(arg: string): string; | ||
export declare function exitCodeInfo(exitCode: number | null): string | undefined; | ||
@@ -9,0 +10,0 @@ export declare function errnoMessage(errno: number | undefined): string; |
@@ -41,2 +41,8 @@ // Copyright 2022 Google LLC | ||
} | ||
export function quotePowerShell(arg) { | ||
if (/^[a-z0-9/_.\-]+$/i.test(arg) || arg === '') { | ||
return arg; | ||
} | ||
return `'` + arg.replace(/'/g, "''") + `'`; | ||
} | ||
export function exitCodeInfo(exitCode) { | ||
@@ -43,0 +49,0 @@ return { |
{ | ||
"name": "zx", | ||
"version": "7.1.0-dev.cfa0fba", | ||
"version": "7.1.0", | ||
"description": "A tool for writing better scripts.", | ||
@@ -5,0 +5,0 @@ "type": "module", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
75518
1516
1