blob: c62e170bb323ee436efac0dace62f2936411080a (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
import { exec } from 'child_process'
import { ServerInfo } from '../server/servers'
function getEnvCli (server?: ServerInfo) {
return `NODE_ENV=test NODE_APP_INSTANCE=${server.internalServerNumber}`
}
async function execCLI (command: string) {
return new Promise<string>((res, rej) => {
exec(command, (err, stdout, stderr) => {
if (err) return rej(err)
return res(stdout)
})
})
}
// ---------------------------------------------------------------------------
export {
execCLI,
getEnvCli
}
|