-
Notifications
You must be signed in to change notification settings - Fork 61
Conversation
Thank you for your contribution. I've just checked and your commit doesn't appear to be signed-off. That's something we need before your Pull Request can be merged. Please see our contributing guide. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a small change please
cmd/create_github.go
Outdated
@@ -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")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please can you inline this? if _, err :=
Nice work 😁 |
be72124
to
f7fb0d7
Compare
cmd/create_github.go
Outdated
@@ -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 the template file. You need to run this command from the root directory of the repository.\n ") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just so that you know, errors in Go cannot start with an uppercase letter or end with a .
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can I suggest this alternative? -> cannot find template "index.html", run this command from the ofc-bootstrap repository
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One more change, again, just stylistic about how Go projects are usually written.
@@ -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 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Spot on 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you need to use ``` backticks for the outer string did this compile ok?
You need to build locally before pushing. This is causing a syntax error. Please remove the newline too.
|
Signed-off-by: kadern0 <kaderno@gmail.com>
That happens when you copy and paste without looking :( my bad! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks perfect. Hope the feedback was useful? Will merge when CI passes
Description
Added check to verify template file exists, if not, an informative message is printed.
Fixes #194
How Has This Been Tested?
Run the test from project's root directory:
Run the test from outside:
Checklist:
I have:
git commit -s