瀏覽代碼

resolve FROM path before sending modelfile (#1211)

Bruce MacDonald 1 年之前
父節點
當前提交
31ab453d37
共有 1 個文件被更改,包括 4 次插入0 次删除
  1. 4 0
      cmd/cmd.go

+ 4 - 0
cmd/cmd.go

@@ -82,6 +82,10 @@ func CreateHandler(cmd *cobra.Command, args []string) error {
 				path = filepath.Join(home, path[2:])
 				path = filepath.Join(home, path[2:])
 			}
 			}
 
 
+			if !filepath.IsAbs(path) {
+				path = filepath.Join(filepath.Dir(filename), path)
+			}
+
 			bin, err := os.Open(path)
 			bin, err := os.Open(path)
 			if errors.Is(err, os.ErrNotExist) && c.Name == "model" {
 			if errors.Is(err, os.ErrNotExist) && c.Name == "model" {
 				continue
 				continue