(options: StopOptions, passthrough: string[])
| 4 | import { runDockerCompose } from '../utils/docker' |
| 5 | |
| 6 | export const runStop = async (options: StopOptions, passthrough: string[]): Promise<number> => { |
| 7 | const composeFiles = ['docker-compose.yml'] |
| 8 | |
| 9 | const includeAll = options.all || (!options.tor && !options.i2p && !options.nginx && !options.local) |
| 10 | |
| 11 | if (includeAll || options.tor) { |
| 12 | composeFiles.push('docker-compose.tor.yml') |
| 13 | } |
| 14 | |
| 15 | if (includeAll || options.i2p) { |
| 16 | composeFiles.push('docker-compose.i2p.yml') |
| 17 | } |
| 18 | |
| 19 | if (includeAll || options.nginx) { |
| 20 | composeFiles.push('docker-compose.nginx.yml') |
| 21 | } |
| 22 | |
| 23 | if (includeAll || options.local) { |
| 24 | composeFiles.push('docker-compose.local.yml') |
| 25 | } |
| 26 | |
| 27 | const spinner = ora('Stopping relay...').start() |
| 28 | const code = await runDockerCompose({ |
| 29 | files: composeFiles, |
| 30 | args: ['down', ...passthrough], |
| 31 | }) |
| 32 | |
| 33 | if (code === 0) { |
| 34 | spinner.succeed('Relay stop command completed') |
| 35 | } else { |
| 36 | spinner.fail('Relay stop command failed') |
| 37 | } |
| 38 | |
| 39 | return code |
| 40 | } |
no test coverage detected