fix #107: windows dnd path error
This commit is contained in:
parent
b374c11c86
commit
2c9de7c56c
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user