Skip to content

Commit

Permalink
fix: fix unreachable code after generating readme
Browse files Browse the repository at this point in the history
Signed-off-by: ankitm123 <[email protected]>
  • Loading branch information
ankitm123 authored and jenkins-x-bot committed Jul 21, 2020
1 parent dd7165f commit 2c4a7f1
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 28 deletions.
54 changes: 27 additions & 27 deletions pkg/environments/gitops.go
Original file line number Diff line number Diff line change
Expand Up @@ -455,38 +455,38 @@ func CreateNestedRequirementDir(dir string, requirementName string, requirementD
err = ioutil.WriteFile(readmeOutPath, []byte(readme), 0600)
if err != nil {
return errors.Wrapf(err, "write README.md to %s", appDir)

if verbose {
log.Logger().Infof("Writing README.md to %s", readmeOutPath)
}
if verbose {
log.Logger().Infof("Writing README.md to %s", readmeOutPath)
}
externalFileHandler := func(path string, element map[string]interface{}, key string) error {
fileName, _ := filepath.Split(path)
err := util.CopyFile(path, filepath.Join(appDir, fileName))
if err != nil {
return errors.Wrapf(err, "copy %s to %s", path, appDir)
}
externalFileHandler := func(path string, element map[string]interface{}, key string) error {
fileName, _ := filepath.Split(path)
err := util.CopyFile(path, filepath.Join(appDir, fileName))
if err != nil {
return errors.Wrapf(err, "copy %s to %s", path, appDir)
}
// key for schema is the filename without the extension
schemaKey := strings.TrimSuffix(fileName, filepath.Ext(fileName))
if schemaPaths, ok := schemas[schemaKey]; ok {
for _, schemaPath := range schemaPaths {
fileName, _ := filepath.Split(schemaPath)
schemaOutPath := filepath.Join(appDir, fileName)
err := util.CopyFile(schemaPath, schemaOutPath)
if err != nil {
return errors.Wrapf(err, "copy %s to %s", schemaPath, appDir)
}
if verbose {
log.Logger().Infof("Writing %s to %s", fileName, schemaOutPath)
}
// key for schema is the filename without the extension
schemaKey := strings.TrimSuffix(fileName, filepath.Ext(fileName))
if schemaPaths, ok := schemas[schemaKey]; ok {
for _, schemaPath := range schemaPaths {
fileName, _ := filepath.Split(schemaPath)
schemaOutPath := filepath.Join(appDir, fileName)
err := util.CopyFile(schemaPath, schemaOutPath)
if err != nil {
return errors.Wrapf(err, "copy %s to %s", schemaPath, appDir)
}
if verbose {
log.Logger().Infof("Writing %s to %s", fileName, schemaOutPath)
}
}
return nil
}
err = helm.HandleExternalFileRefs(rootValues, possibles, "", externalFileHandler)
if err != nil {
return err
}
return nil
}
err = helm.HandleExternalFileRefs(rootValues, possibles, "", externalFileHandler)
if err != nil {
return err
}

return nil
}

Expand Down
1 change: 0 additions & 1 deletion pkg/pipelinescheduler/scheduler_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,6 @@ func buildSchedulerProtectionPolicies(repo string, prowConfig *config.Config) *j
ProtectionPolicy: repoPolicy,
Items: protectionPolicies,
}
return nil
}

func buildSchedulerRequiredPullRequestReviews(requiredPullRequestReviews *config.ReviewPolicy) *jenkinsv1.ReviewPolicy {
Expand Down

0 comments on commit 2c4a7f1

Please sign in to comment.