Skip to content

Commit

Permalink
Link to Starter Kits during compute init (#730)
Browse files Browse the repository at this point in the history
* feat(compute): relax git regex to allow GitHub URL without `.git` suffix

* refactor(compute): add link to DevHub starter kits during `compute init`
  • Loading branch information
Integralist authored Dec 8, 2022
1 parent 903492b commit cb23d32
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/commands/compute/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (
)

var (
gitRepositoryRegEx = regexp.MustCompile(`((git|ssh|http(s)?)|(git@[\w\.]+))(:(//)?)([\w\.@\:/\-~]+)(\.git)(/)?`)
gitRepositoryRegEx = regexp.MustCompile(`((git|ssh|http(s)?)|(git@[\w\.]+))(:(//)?)([\w\.@\:/\-~]+)(\.git)?(/)?`)
fastlyOrgRegEx = regexp.MustCompile(`^https:\/\/github\.com\/fastly`)
fastlyFileIgnoreListRegEx = regexp.MustCompile(`\.github|LICENSE|SECURITY\.md|CHANGELOG\.md|screenshot\.png`)
)
Expand Down Expand Up @@ -513,6 +513,10 @@ func promptForStarterKit(flags config.Flag, kits []config.StarterKit, in io.Read
fmt.Fprintf(out, "[%d] %s\n", i+1, text.Bold(kit.Name))
text.Indent(out, 4, "%s\n%s", kit.Description, kit.Path)
}

text.Info(out, "For a complete list of Starter Kits:\n\thttps://developer.fastly.com/solutions/starters/")
text.Break(out)

option, err = text.Input(out, "Choose option or paste git URL: [1] ", in, validateTemplateOptionOrURL(kits))
if err != nil {
return "", "", "", fmt.Errorf("error reading input: %w", err)
Expand Down

0 comments on commit cb23d32

Please sign in to comment.