Skip to content

Commit 201e5f2

Browse files
committed
fix: remove superflous input.FromURL function
Signed-off-by: tylerslaton <[email protected]>
1 parent 377e668 commit 201e5f2

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

pkg/cli/parse.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"strings"
77

88
"github.com/gptscript-ai/gptscript/pkg/input"
9+
"github.com/gptscript-ai/gptscript/pkg/loader"
910
"github.com/gptscript-ai/gptscript/pkg/parser"
1011
"github.com/spf13/cobra"
1112
)
@@ -37,16 +38,15 @@ func (e *Parse) Run(_ *cobra.Command, args []string) error {
3738
content, fileErr = input.FromFile(args[0])
3839
if fileErr != nil {
3940
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])
4142
if err != nil {
4243
return err
4344
}
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.
4546
if content == "" {
4647
log.Debugf("no content found for %s, returning original error.", args[0])
4748
return fileErr
4849
}
49-
5050
}
5151

5252
docs, err := parser.Parse(strings.NewReader(content), parser.Options{

pkg/input/input.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ import (
55
"io"
66
"os"
77
"strings"
8-
9-
"github.com/gptscript-ai/gptscript/pkg/loader"
108
)
119

1210
func FromArgs(args []string) string {
@@ -41,7 +39,3 @@ func FromFile(file string) (string, error) {
4139

4240
return "", nil
4341
}
44-
45-
func FromURL(url string) (string, error) {
46-
return loader.ContentFromURL(url)
47-
}

0 commit comments

Comments
 (0)