fix FROM instruction erroring when referring to a file

This commit is contained in:
Jeffrey Morgan
2023-08-22 09:39:42 -07:00
parent 0a892419ad
commit a9f6c56652
5 changed files with 47 additions and 115 deletions

View File

@@ -102,11 +102,15 @@ func RunHandler(cmd *cobra.Command, args []string) error {
return err
}
mp, err := server.ParseModelPath(args[0], insecure)
mp := server.ParseModelPath(args[0])
if err != nil {
return err
}
if mp.ProtocolScheme == "http" && !insecure {
return fmt.Errorf("insecure protocol http")
}
fp, err := mp.GetManifestPath(false)
if err != nil {
return err
@@ -515,7 +519,7 @@ func generateInteractive(cmd *cobra.Command, model string) error {
case strings.HasPrefix(line, "/show"):
args := strings.Fields(line)
if len(args) > 1 {
mp, err := server.ParseModelPath(model, false)
mp := server.ParseModelPath(model)
if err != nil {
return err
}