(
guide: string,
commands: string[],
additionalEnvVariables: { [key: string]: string } = {},
)
| 35 | } |
| 36 | |
| 37 | async runShell( |
| 38 | guide: string, |
| 39 | commands: string[], |
| 40 | additionalEnvVariables: { [key: string]: string } = {}, |
| 41 | ): Promise<string> { |
| 42 | let command = ''; |
| 43 | for (const key in additionalEnvVariables) { |
| 44 | command += `export ${key}="${additionalEnvVariables[key] as string}"\n`; |
| 45 | } |
| 46 | command += commands.join(' && '); |
| 47 | console.log(`${wrapInColor(guide, ANSI_COLORS.YELLOW_COLOR)}...`); |
| 48 | for (const command of commands) { |
| 49 | console.log(`- ${command}`); |
| 50 | } |
| 51 | |
| 52 | const result = await spawnCliCommand(command, undefined, 'inherit', false, true); |
| 53 | return result.stdout; |
| 54 | } |
| 55 | |
| 56 | async writeEnvVariablesToRcFile(envVariables: readonly EnvVariable[]): Promise<void> { |
| 57 | const expectedEnvVariable = envVariables.map(e => `export ${e.name}=${e.value}`); |
no test coverage detected