diff --git a/common/config.go b/common/config.go index cc7eced6a..02b214902 100644 --- a/common/config.go +++ b/common/config.go @@ -131,5 +131,12 @@ func DownloadableURL(original string) (string, error) { return "", fmt.Errorf("Unsupported URL scheme: %s", url.Scheme) } + // if cleaned filepath does not exist, error out now. + if url.Scheme == "file" { + if _, err := os.Stat(url.Path); err != nil { + return "", fmt.Errorf("The filepath doesn't exist either as a "+ + "relative or an absolute path: %s", err) + } + } return url.String(), nil }