(name: string, value: string)
| 332 | } |
| 333 | |
| 334 | function setEnvironmentVariable(name: string, value: string) { |
| 335 | const platform = os.platform(); |
| 336 | let command: string; |
| 337 | |
| 338 | if (platform === "win32") { |
| 339 | command = `set ${name}=${value}`; // Windows Command Prompt |
| 340 | } else { |
| 341 | command = `export ${name}=${value}`; // Unix-like shells |
| 342 | } |
| 343 | |
| 344 | console.log( |
| 345 | `\x1b[33mPlease run this command: ${command} and then rerun the setup script.\x1b[0m`, |
| 346 | ); |
| 347 | process.exit(1); |
| 348 | } |
| 349 | |
| 350 | async function main() { |
| 351 | try { |