Skip to content

Commit

Permalink
fix: get build to pass
Browse files Browse the repository at this point in the history
  • Loading branch information
J0 committed Apr 6, 2024
1 parent 3f48bdb commit 332e012
Showing 1 changed file with 5 additions and 16 deletions.
21 changes: 5 additions & 16 deletions internal/bootstrap/bootstrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"context"
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
"os"
Expand Down Expand Up @@ -35,17 +34,6 @@ import (
"golang.org/x/term"
)

type Sample struct {
Name string `json:"name"`
Description string `json:"description"`
URL string `json:"url"`
Start string `json:"start"`
}

type SamplesFile struct {
Samples []Sample `json:"samples"`
}

func Run(ctx context.Context, templateUrl string, fsys afero.Fs, options ...func(*pgx.ConnConfig)) error {
workdir := viper.GetString("WORKDIR")
if !filepath.IsAbs(workdir) {
Expand Down Expand Up @@ -149,15 +137,15 @@ func suggestAppStart(cwd string) string {
if len(workdir) > 0 && workdir != "." {
cmd = append(cmd, "cd "+workdir)
}
fileBytes, err := ioutil.ReadFile("samples.json")
fileBytes, err := os.ReadFile("samples.json")
if err != nil {
return errors.Errorf("failed to read file: %v", err)
fmt.Fprintln(logger, err)
}

var samples SamplesFile
var samples samplesRepo
err = json.Unmarshal(fileBytes, &samples)
if err != nil {
return errors.Errorf("failed to unmarshal JSON: %v", err)
fmt.Fprintln(logger, err)
}

for _, sample := range samples.Samples {
Expand Down Expand Up @@ -332,6 +320,7 @@ type StarterTemplate struct {
Name string `json:"name"`
Description string `json:"description"`
Url string `json:"url"`
Start string `json:"start"`
}

func ListSamples(ctx context.Context, client *github.Client) ([]StarterTemplate, error) {
Expand Down

0 comments on commit 332e012

Please sign in to comment.