Skip to content

Commit

Permalink
feat: update kusion project and stack create (#1065)
Browse files Browse the repository at this point in the history
  • Loading branch information
liu-hm19 committed Apr 24, 2024
1 parent fddd4d1 commit cfd6212
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
8 changes: 7 additions & 1 deletion pkg/cmd/project/create/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,5 +70,11 @@ func (o *Options) Run() error {
path := filepath.Join(o.ProjectDir, util.ProjectYAMLFile)
content := fmt.Sprintf(util.ProjectYAMLTemplate, o.Name)

return os.WriteFile(path, []byte(content), 0o644)
if err := os.WriteFile(path, []byte(content), 0o644); err != nil {
return err
}

fmt.Printf("Created project '%s' successfully\n", o.Name)

return nil
}
6 changes: 5 additions & 1 deletion pkg/cmd/stack/create/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,12 @@ func (o *Options) Run() error {
return err
}
} else {
return util.CreateWithRefStack(o.Name, o.StackDir, o.CopyFrom)
if err := util.CreateWithRefStack(o.Name, o.StackDir, o.CopyFrom); err != nil {
return err
}
}

fmt.Printf("Created stack '%s' under project directory '%s' successfully\n", o.Name, o.ProjectDir)

return nil
}

0 comments on commit cfd6212

Please sign in to comment.