Compare commits

..

2 Commits

Author SHA1 Message Date
2bfb5ffddf chore: bump version to v0.2.10
All checks were successful
continuous-integration/drone/tag Build is passing
continuous-integration/drone/push Build is passing
2024-11-04 14:25:02 +09:00
2c9de7c56c fix #107: windows dnd path error 2024-11-04 14:24:32 +09:00

View File

@ -32,7 +32,7 @@ import (
"unlock-music.dev/cli/internal/utils" "unlock-music.dev/cli/internal/utils"
) )
var AppVersion = "v0.2.9" var AppVersion = "v0.2.10"
var logger = setupLogger(false) // TODO: inject logger to application, instead of using global logger var logger = setupLogger(false) // TODO: inject logger to application, instead of using global logger
@ -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") output := c.String("output")
inputStat, err := os.Stat(input) inputStat, err := os.Stat(input)
if err != nil { if err != nil {
@ -147,6 +152,10 @@ func appMain(c *cli.Context) (err error) {
} else { } else {
inputDir = path.Dir(input) inputDir = path.Dir(input)
} }
inputDir, absErr = filepath.Abs(inputDir)
if absErr != nil {
return fmt.Errorf("get abs path (inputDir) failed: %w", absErr)
}
if output == "" { if output == "" {
// Default to where the input dir is // Default to where the input dir is