(s string)
| 269 | var shellSafe = regexp.MustCompile(`^[A-Za-z0-9_@%+=:,./-]+$`) |
| 270 | |
| 271 | func shellQuote(s string) string { |
| 272 | if shellSafe.MatchString(s) { |
| 273 | return s |
| 274 | } |
| 275 | return "'" + strings.ReplaceAll(s, "'", `'\''`) + "'" |
| 276 | } |
| 277 | |
| 278 | // runBinary runs one gh binary in its own scratch folder. With ca, gh uses |
| 279 | // github.com and trusts only ca; without it, gh uses github.localhost. |
no outgoing calls