File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change 77 "net/http"
88 "os"
99
10+ "github.com/replicatedhq/troubleshoot/cmd/util"
1011 analyzer "github.com/replicatedhq/troubleshoot/pkg/analyze"
1112 "github.com/replicatedhq/troubleshoot/pkg/convert"
1213 "github.com/replicatedhq/troubleshoot/pkg/logger"
@@ -83,7 +84,8 @@ func Analyze() *cobra.Command {
8384
8485func downloadAnalyzerSpec (specPath string ) (string , error ) {
8586 specContent := ""
86- if ! isURL (specPath ) {
87+ var err error
88+ if _ , err = os .Stat (specPath ); err == nil {
8789 if _ , err := os .Stat (specPath ); os .IsNotExist (err ) {
8890 return "" , fmt .Errorf ("%s was not found" , specPath )
8991 }
@@ -95,6 +97,10 @@ func downloadAnalyzerSpec(specPath string) (string, error) {
9597
9698 specContent = string (b )
9799 } else {
100+ if ! util .IsURL (specPath ) {
101+ return "" , fmt .Errorf ("%s is not a URL and was not found (err %s)" , specPath , err )
102+ }
103+
98104 req , err := http .NewRequest ("GET" , specPath , nil )
99105 if err != nil {
100106 return "" , err
You can’t perform that action at this time.
0 commit comments