From 16f9fe4e41139b0fb239898ff17d8e64b2ab53cf Mon Sep 17 00:00:00 2001 From: kaderno Date: Mon, 2 Mar 2020 20:45:47 +1100 Subject: [PATCH] Added check for template file Signed-off-by: kadern0 --- cmd/create_github.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmd/create_github.go b/cmd/create_github.go index 44930d0..4384b41 100644 --- a/cmd/create_github.go +++ b/cmd/create_github.go @@ -7,6 +7,7 @@ import ( "net/url" "os" "os/exec" + "path" "runtime" "strings" "time" @@ -64,6 +65,10 @@ func createGitHubAppE(command *cobra.Command, _ []string) error { "GitHubEvent": fmt.Sprintf("%s://system.%s/github-event", scheme, rootDomain), } + if _, err := os.Stat(path.Join("./pkg/github", "index.html")); err != nil { + return fmt.Errorf(`cannot find template "index.html", run this command from the ofc-bootstrap repository`) + } + fmt.Printf("Name: %s\tRoot domain: %s\tScheme: %v\n", name, rootDomain, scheme) launchBrowser := true