-
Notifications
You must be signed in to change notification settings - Fork 353
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add option to run from URL #156
Conversation
I didn't add any option, I checked if the fileName provided is an url http or https and work in that direction |
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 good! Just a minor comment
pkg/client/cmd/run.go
Outdated
} else { | ||
resp, err := http.Get(fileName) | ||
if err != nil { | ||
return errors.New("The URL provided is not reachable " + fileName) |
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.
You can use errors.wrap
here (from the other errors
package) so you don't lose the error cause
pkg/client/cmd/run.go
Outdated
if err != nil { | ||
return errors.New("The URL provided is not reachable " + fileName) | ||
} else if resp.StatusCode != 200 { | ||
return errors.New("The URL provided is not reachable " + fileName) |
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.
Same
Done. |
You mean the same also on the control on Filesystem I suppose, I'll update there too. |
Done |
Fixes #137