Skip to content
This repository has been archived by the owner on Feb 2, 2021. It is now read-only.

Commit

Permalink
Added check for template file
Browse files Browse the repository at this point in the history
  • Loading branch information
kadern0 committed Mar 2, 2020
1 parent ee11754 commit e0a5f58
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion cmd/create_github.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"net/url"
"os"
"os/exec"
"path"
"runtime"
"strings"
"time"
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit e0a5f58

Please sign in to comment.