Get parses the provided URL and the script name.
(script string)
| 72 | |
| 73 | // Get parses the provided URL and the script name. |
| 74 | func (s *URLScriptHandler) Get(script string) *api.InstallResult { |
| 75 | if len(s.URL) == 0 { |
| 76 | return nil |
| 77 | } |
| 78 | scriptURL, err := url.ParseRequestURI(s.URL + "/" + script) |
| 79 | if err != nil { |
| 80 | log.Infof("invalid script url %q: %v", s.URL, err) |
| 81 | return nil |
| 82 | } |
| 83 | return &api.InstallResult{ |
| 84 | Script: script, |
| 85 | URL: scriptURL.String(), |
| 86 | } |
| 87 | } |
| 88 | |
| 89 | // Install downloads the script and fix its permissions. |
| 90 | func (s *URLScriptHandler) Install(r *api.InstallResult) error { |