Skip to content

Commit

Permalink
fixing dockerfile/deployment only creation with skip-file-detection (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
karenychen authored Jul 8, 2022
1 parent fded63f commit 259023d
Showing 1 changed file with 15 additions and 10 deletions.
25 changes: 15 additions & 10 deletions cmd/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -257,22 +257,27 @@ func (cc *createCmd) createDeployment() error {

func (cc *createCmd) createFiles(detectedLang *config.DraftConfig, lowerLang string) error {
// does no further checks without file detection

if cc.dockerfileOnly && cc.deploymentOnly {
return errors.New("can only pass in one of --dockerfile-only and --deployment-only")
}

if cc.skipFileDetection {
err := cc.generateDockerfile(detectedLang, lowerLang)
if err != nil {
return err
if !cc.deploymentOnly {
err := cc.generateDockerfile(detectedLang, lowerLang)
if err != nil {
return err
}
}
err = cc.createDeployment()
if err != nil {
return err
if !cc.dockerfileOnly {
err := cc.createDeployment()
if err != nil {
return err
}
}
return nil
}

if cc.dockerfileOnly && cc.deploymentOnly {
return errors.New("can only pass in one of --dockerfile-only and --deployment-only")
}

// check if the local directory has dockerfile or charts
hasDockerFile, hasDeploymentFiles, err := filematches.SearchDirectory(cc.dest)
if err != nil {
Expand Down

0 comments on commit 259023d

Please sign in to comment.