diff --git a/cmd/create_github.go b/cmd/create_github.go index 44930d0..8fcfe82 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,11 @@ func createGitHubAppE(command *cobra.Command, _ []string) error { "GitHubEvent": fmt.Sprintf("%s://system.%s/github-event", scheme, rootDomain), } + _, err := os.Stat(path.Join("./pkg/github", "index.html")) + if err != nil { + return fmt.Errorf("Cannot find the template file. You need to run this command from the root directory of the repository.\n ") + } + fmt.Printf("Name: %s\tRoot domain: %s\tScheme: %v\n", name, rootDomain, scheme) launchBrowser := true @@ -79,7 +85,7 @@ func createGitHubAppE(command *cobra.Command, _ []string) error { cancel() }() - err := receiveGitHubApp(context, inputMap, resCh, launchBrowser, port) + err = receiveGitHubApp(context, inputMap, resCh, launchBrowser, port) if err != nil { return err