Skip to content

Commit

Permalink
replace helm cli command with go client (#451)
Browse files Browse the repository at this point in the history
* replace helm cli command with go client

* improve error handling
  • Loading branch information
zreigz authored Sep 15, 2023
1 parent cf6e22c commit b4a908a
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion pkg/scaffold/creator.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"github.com/pluralsh/plural/pkg/api"
"github.com/pluralsh/plural/pkg/utils"
"github.com/pluralsh/plural/pkg/utils/pathing"
"helm.sh/helm/v3/pkg/chartutil"
)

var categories = []string{
Expand Down Expand Up @@ -77,7 +78,7 @@ func ApplicationScaffold(client api.Client) error {
return err
}

if err := utils.Exec("helm", "create", app); err != nil {
if err := createHelm(app); err != nil {
return err
}

Expand All @@ -93,3 +94,9 @@ func ApplicationScaffold(client api.Client) error {

return nil
}

func createHelm(name string) error {
chartname := filepath.Base(name)
_, err := chartutil.Create(chartname, filepath.Dir(name))
return err
}

0 comments on commit b4a908a

Please sign in to comment.