(s: string)
| 145 | } |
| 146 | |
| 147 | private pushStringValue(s: string) { |
| 148 | if (s === '') { |
| 149 | return |
| 150 | } |
| 151 | // All other kinds of escapes are handled by node's child_process.spawn. |
| 152 | if (s.startsWith('-') && (!this.mergeable || this.args[this.args.length - 1] === '-')) { |
| 153 | throw new Error( |
| 154 | repr`forbidden argument ${s} starts with a dash. For flags, use trustedArg or move to string part.`, |
| 155 | ) |
| 156 | } |
| 157 | this.pushMergeableValue(s) |
| 158 | } |
| 159 | |
| 160 | private pushStandaloneValue(s: string) { |
| 161 | this.args.push(s) |
no test coverage detected