Skip to content

Commit

Permalink
Warn if process type doesn't exist
Browse files Browse the repository at this point in the history
  • Loading branch information
eablack committed Aug 22, 2024
1 parent 3d9c5ea commit 3028fb0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
5 changes: 0 additions & 5 deletions packages/cli/src/commands/container/push.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,6 @@ export default class Push extends Command {
const jobs = await selectJobs(possibleJobs, processTypes as string[], recursive)

if (jobs.length === 0) {
if (processTypes.length > 0) {
for (const processType of processTypes) {
ux.warn(`Dockerfile.${processType} not found`)
}
}
ux.error('No images to push', {exit: 1})
}

Expand Down
6 changes: 6 additions & 0 deletions packages/cli/src/lib/container/docker_helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import * as glob from 'glob'
import * as Path from 'path'
import * as inquirer from 'inquirer'
import * as os from 'os'
import {ux} from '@oclif/core'

const DOCKERFILE_REGEX = /\bDockerfile(.\w*)?$/

Expand Down Expand Up @@ -140,6 +141,11 @@ export const chooseJobs = async function (jobs: groupedDockerJobs) {
for (const processType in jobs) {
if (Object.prototype.hasOwnProperty.call(jobs, processType)) {
const group = jobs[processType]
if (group === undefined) {
ux.warn(`Dockerfile.${processType} not found`)
continue
}

if (group.length > 1) {
const prompt = [{
type: 'list',
Expand Down

0 comments on commit 3028fb0

Please sign in to comment.