Skip to content

Commit 80a6af4

Browse files
Mossakaclaude
andcommitted
refactor: use validation function in CLI action handler
Simplify the --skip-pull validation by using the extracted validateSkipPullWithBuildLocal function instead of inline checks. This reduces code duplication and improves coverage. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent fa54225 commit 80a6af4

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

src/cli.ts

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -852,20 +852,12 @@ program
852852
}
853853

854854
// Error if --skip-pull is used with --build-local (incompatible flags)
855-
if (config.skipPull && config.buildLocal) {
856-
logger.error('❌ --skip-pull cannot be used with --build-local');
857-
logger.error(' Building images requires pulling base images from the registry');
858-
logger.error(' Use --skip-pull only with pre-built GHCR images');
855+
const skipPullValidation = validateSkipPullWithBuildLocal(config.skipPull, config.buildLocal);
856+
if (!skipPullValidation.valid) {
857+
logger.error(`❌ ${skipPullValidation.error}`);
859858
process.exit(1);
860859
}
861860

862-
// Warn about security implications when using --skip-pull
863-
if (config.skipPull) {
864-
logger.warn('⚠️ Using --skip-pull: Local images will be used without pulling from registry');
865-
logger.warn(' You are responsible for verifying image authenticity');
866-
logger.warn(' See: docs/image-verification.md for verification instructions');
867-
}
868-
869861
// Warn if --enable-host-access is used with host.docker.internal in allowed domains
870862
if (config.enableHostAccess) {
871863
const hasHostDomain = allowedDomains.some(d =>

0 commit comments

Comments
 (0)