(files: string[], args: string[])
| 14 | export const resolveComposeFile = (filename: string): string => getProjectPath(filename) |
| 15 | |
| 16 | export const buildComposeArgs = (files: string[], args: string[]): string[] => { |
| 17 | const out: string[] = [] |
| 18 | |
| 19 | for (const file of files) { |
| 20 | const fullPath = resolveComposeFile(file) |
| 21 | if (fs.existsSync(fullPath)) { |
| 22 | out.push('-f', fullPath) |
| 23 | } |
| 24 | } |
| 25 | |
| 26 | return [...out, ...args] |
| 27 | } |
| 28 | |
| 29 | export const runDockerCompose = async ({ files, args, env }: ComposeOptions): Promise<number> => { |
| 30 | const composeArgs = buildComposeArgs(files, args) |
no test coverage detected