From 2c9de7c56c4a44f519993912490c5c6b8771e806 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=B2=81=E6=A0=91=E4=BA=BA?= Date: Mon, 4 Nov 2024 14:24:32 +0900 Subject: [PATCH] fix #107: windows dnd path error --- cmd/um/main.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/cmd/um/main.go b/cmd/um/main.go index 2fd15b6..325d9f2 100644 --- a/cmd/um/main.go +++ b/cmd/um/main.go @@ -135,6 +135,11 @@ func appMain(c *cli.Context) (err error) { } } + input, absErr := filepath.Abs(input) + if absErr != nil { + return fmt.Errorf("get abs path failed: %w", absErr) + } + output := c.String("output") inputStat, err := os.Stat(input) if err != nil { @@ -147,6 +152,10 @@ func appMain(c *cli.Context) (err error) { } else { inputDir = path.Dir(input) } + inputDir, absErr = filepath.Abs(inputDir) + if absErr != nil { + return fmt.Errorf("get abs path (inputDir) failed: %w", absErr) + } if output == "" { // Default to where the input dir is