| 20222 | if (this._isCmdFile()) { |
| 20223 | return process.env["COMSPEC"] || "cmd.exe"; |
| 20224 | } |
| 20225 | } |
| 20226 | return this.toolPath; |
| 20227 | } |
| 20228 | _getSpawnArgs(options) { |
| 20229 | if (IS_WINDOWS2) { |
| 20230 | if (this._isCmdFile()) { |
| 20231 | let argline = `/D /S /C "${this._windowsQuoteCmdArg(this.toolPath)}`; |
| 20232 | for (const a of this.args) { |
| 20233 | argline += " "; |
| 20234 | argline += options.windowsVerbatimArguments ? a : this._windowsQuoteCmdArg(a); |
| 20235 | } |
| 20236 | argline += '"'; |
| 20237 | return [argline]; |
| 20238 | } |
| 20239 | } |
| 20240 | return this.args; |
| 20241 | } |
| 20242 | _endsWith(str, end) { |
| 20243 | return str.endsWith(end); |
| 20244 | } |
| 20245 | _isCmdFile() { |
| 20246 | const upperToolPath = this.toolPath.toUpperCase(); |
| 20247 | return this._endsWith(upperToolPath, ".CMD") || this._endsWith(upperToolPath, ".BAT"); |
| 20248 | } |
| 20249 | _windowsQuoteCmdArg(arg) { |
| 20250 | if (!this._isCmdFile()) { |
| 20251 | return this._uvQuoteCmdArg(arg); |
| 20252 | } |