Skip to content

Commit

Permalink
fix init command requires Chart.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
kvaps committed May 3, 2024
1 parent cc4bbea commit 5130f96
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,12 @@ func initConfig() {
if cmd == nil {
return
}
if cmd.Use == "init" {
commands.Config.InitOptions.Version = Version
if strings.HasPrefix(cmd.Use, "init") {
if strings.HasPrefix(Version, "v") {
commands.Config.InitOptions.Version = strings.TrimPrefix(Version, `v`)
} else {
commands.Config.InitOptions.Version = "0.1.0"
}
} else {
configFile := filepath.Join(commands.Config.RootDir, "Chart.yaml")
if err := loadConfig(configFile); err != nil {
Expand Down

0 comments on commit 5130f96

Please sign in to comment.