From 31ab453d37f08e7f13f0bda37d9963755de23632 Mon Sep 17 00:00:00 2001 From: Bruce MacDonald Date: Mon, 20 Nov 2023 16:43:48 -0500 Subject: [PATCH] resolve FROM path before sending modelfile (#1211) --- cmd/cmd.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmd/cmd.go b/cmd/cmd.go index 2c48ca80..8990a652 100644 --- a/cmd/cmd.go +++ b/cmd/cmd.go @@ -82,6 +82,10 @@ func CreateHandler(cmd *cobra.Command, args []string) error { path = filepath.Join(home, path[2:]) } + if !filepath.IsAbs(path) { + path = filepath.Join(filepath.Dir(filename), path) + } + bin, err := os.Open(path) if errors.Is(err, os.ErrNotExist) && c.Name == "model" { continue