rename exePath var. return exepath err
This commit is contained in:
parent
5892e4f8b6
commit
0568b39d91
@ -78,9 +78,9 @@ func epwingExportDb(inputPath, outputPath, language, title string, stride int, p
|
|||||||
|
|
||||||
var data []byte
|
var data []byte
|
||||||
if toolExec {
|
if toolExec {
|
||||||
ex, err := os.Executable()
|
exePath, err := os.Executable()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
toolPath := filepath.Join("bin", runtime.GOOS, "zero-epwing")
|
toolPath := filepath.Join("bin", runtime.GOOS, "zero-epwing")
|
||||||
@ -88,7 +88,7 @@ func epwingExportDb(inputPath, outputPath, language, title string, stride int, p
|
|||||||
toolPath += ".exe"
|
toolPath += ".exe"
|
||||||
}
|
}
|
||||||
|
|
||||||
toolPath = filepath.Join(filepath.Dir(ex), toolPath)
|
toolPath = filepath.Join(filepath.Dir(exePath), toolPath)
|
||||||
|
|
||||||
if _, err = os.Stat(toolPath); err != nil {
|
if _, err = os.Stat(toolPath); err != nil {
|
||||||
return fmt.Errorf("failed to find zero-epwing in '%s'", toolPath)
|
return fmt.Errorf("failed to find zero-epwing in '%s'", toolPath)
|
||||||
|
Loading…
Reference in New Issue
Block a user