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

Commit

Permalink
Move github app HTML templates to templates folder
Browse files Browse the repository at this point in the history
The html templates for the github app creation helper have been moved
into `./templates/github/` so a user can avoid copying extra
files/folders if using ofc-bootstrap outside the clone dir.

This was tested by building and running the create-github-app command
and generating a github app

Signed-off-by: Alistair Hey <[email protected]>
  • Loading branch information
Waterdrips authored and alexellis committed May 11, 2020
1 parent 9eacb6e commit 88f790d
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 39 deletions.
2 changes: 1 addition & 1 deletion cmd/create_github.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ 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 {
if _, err := os.Stat(path.Join("./templates", "github", "index.html")); err != nil {
return fmt.Errorf(`cannot find template "index.html", run this command from the ofc-bootstrap repository`)
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/github/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func MakeHandler(inputMap map[string]string, resCh chan AppResult) func(w http.R
if r.URL.Path == "/" || r.URL.Path == "" {

var outBuffer bytes.Buffer
tmpl, err := template.ParseFiles(path.Join("./pkg/github", "index.html"))
tmpl, err := template.ParseFiles(path.Join("./templates/github", "index.html"))
err = tmpl.Execute(&outBuffer, &inputMap)
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
Expand Down
37 changes: 0 additions & 37 deletions pkg/github/result.html

This file was deleted.

File renamed without changes.

0 comments on commit 88f790d

Please sign in to comment.