MCPcopy Create free account
hub / github.com/cameri/nostream / runStop

Function runStop

src/cli/commands/stop.ts:6–40  ·  view source on GitHub ↗
(options: StopOptions, passthrough: string[])

Source from the content-addressed store, hash-verified

4import { runDockerCompose } from '../utils/docker'
5
6export 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}

Callers 5

index.tsFile · 0.90
runStopMenuFunction · 0.90
runUpdateFunction · 0.90
restartRelayFunction · 0.90
runDevDockerCleanFunction · 0.90

Calls 1

runDockerComposeFunction · 0.90

Tested by

no test coverage detected