Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export const runCommand = async (cmd: string): Promise =>
system.run(`node ${join(__dirname, '../bin/zce.js')} ${cmd}`)
async function getReachableIP() {
print.info(`Starting Docker IP Detection`);
try {
await system.run(`docker image inspect ${DOCKER_CURL}`);
print.info(
`docker image ${print.colors.success('✔')} ${print.colors.warning(
DOCKER_CURL
)} already exists`
);
} catch (err) {
const spinner1 = print.spin(
`Fetching ${print.colors.warning(DOCKER_CURL)} image`
);
await system.run(`docker pull ${DOCKER_CURL}`);
spinner1.succeed();
}
const port = await getPort();
const spinner2 = print.spin(
`Starting dummy HTTP server on port ${print.colors.warning(
return async ({ cmd, msg, options }) => {
const command = `docker-compose -f "${compose}" ${cmd}`;
if (async) {
const spinner = msg && print.spin(msg);
try {
const output = await system.run(command);
msg && spinner.succeed();
return output;
} catch (err) {
msg && spinner.fail(err.stderr);
throw err;
}
}
return execSync(command, options);
};
}