File tree 2 files changed +3
-9
lines changed
2 files changed +3
-9
lines changed Original file line number Diff line number Diff line change 6
6
"strings"
7
7
8
8
"github.com/gptscript-ai/gptscript/pkg/input"
9
+ "github.com/gptscript-ai/gptscript/pkg/loader"
9
10
"github.com/gptscript-ai/gptscript/pkg/parser"
10
11
"github.com/spf13/cobra"
11
12
)
@@ -37,16 +38,15 @@ func (e *Parse) Run(_ *cobra.Command, args []string) error {
37
38
content , fileErr = input .FromFile (args [0 ])
38
39
if fileErr != nil {
39
40
log .Debugf ("failed to read file %s (due to %v) attempting to load the URL..." , args [0 ], err )
40
- content , err = input . FromURL (args [0 ])
41
+ content , err = loader . ContentFromURL (args [0 ])
41
42
if err != nil {
42
43
return err
43
44
}
44
- // If the content is empty and there was no error, return the file error
45
+ // If the content is empty and there was no error, this is not a remote file. Return the file error.
45
46
if content == "" {
46
47
log .Debugf ("no content found for %s, returning original error." , args [0 ])
47
48
return fileErr
48
49
}
49
-
50
50
}
51
51
52
52
docs , err := parser .Parse (strings .NewReader (content ), parser.Options {
Original file line number Diff line number Diff line change 5
5
"io"
6
6
"os"
7
7
"strings"
8
-
9
- "github.com/gptscript-ai/gptscript/pkg/loader"
10
8
)
11
9
12
10
func FromArgs (args []string ) string {
@@ -41,7 +39,3 @@ func FromFile(file string) (string, error) {
41
39
42
40
return "" , nil
43
41
}
44
-
45
- func FromURL (url string ) (string , error ) {
46
- return loader .ContentFromURL (url )
47
- }
You can’t perform that action at this time.
0 commit comments