Skip to content

Commit

Permalink
Better samples configuration (stripe#243)
Browse files Browse the repository at this point in the history
* Read off of sample config json file

* Use publishable key and also print post install

* Fix linter issues

* Refactor samples more

* Remove unneeded package rename

* Rename integration struct to be clearer

* Add comments explaining client and servers for integrations

* Handle 0 client/server cases
  • Loading branch information
tomer-stripe authored Oct 31, 2019
1 parent 874a7f8 commit df816ab
Show file tree
Hide file tree
Showing 4 changed files with 172 additions and 519 deletions.
5 changes: 1 addition & 4 deletions pkg/cmd/gen_events_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,13 @@ const (
pathOutput = "events_list.go"
)


func main() {
// generate `events_list.go` from OpenAPI spec file
// code for this func from gen_resources_cmds.go

// load spec
templateData, err := getTemplateData()
if (err != nil) {
if err != nil {
panic(err)
}

Expand Down Expand Up @@ -62,7 +61,6 @@ func main() {

}


func getTemplateData() (*TemplateData, error) {
data := &TemplateData{
Events: make([]string, 0),
Expand All @@ -84,4 +82,3 @@ func getTemplateData() (*TemplateData, error) {
return data, nil

}

9 changes: 4 additions & 5 deletions pkg/cmd/samples/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,14 +145,13 @@ To see supported samples, run 'stripe samples list'`, args[0])
return err
}

err = sample.PointToDotEnv(targetPath)
if err != nil {
return err
}

ansi.StopSpinner(spinner, "", os.Stdout)
fmt.Println(fmt.Sprintf("%s %s", color.Green("✔"), ansi.Faint("Project configured")))
fmt.Println("You're all set. To get started: cd", selectedSample)

if sample.PostInstall() != "" {
fmt.Println(sample.PostInstall())
}

return nil
}
Loading

0 comments on commit df816ab

Please sign in to comment.