Skip to content

Commit 24fcb64

Browse files
committed
fix: donot exit immediately on file not found
1 parent b25358a commit 24fcb64

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

src/cli.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,13 +141,20 @@ cliAction.file.forEach((file, pos) => {
141141
}
142142

143143
if (!fileExists(file)) {
144-
console.log(chalk.red('docker-compose file not found at: ' + file));
145-
process.exit(1);
144+
console.log(chalk.yellow('docker-compose file not found at: ' + file));
145+
146+
return;
146147
}
147148

148149
dockerComposeFiles.push('--file', file);
149150
});
150151

152+
if (dockerComposeFiles.length === 0) {
153+
console.log(chalk.red('at least one docker-compose file is required to exist'));
154+
155+
process.exit(1);
156+
}
157+
151158
const cliOptions = {
152159
cwd: basePath,
153160
stdio: 'inherit',

0 commit comments

Comments
 (0)