Merge pull request #21 from playHing/normal-flow
Fix the path to get zero-epwing
This commit is contained in:
commit
fc189b9b83
@ -78,14 +78,17 @@ func epwingExportDb(inputPath, outputPath, language, title string, stride int, p
|
|||||||
|
|
||||||
var data []byte
|
var data []byte
|
||||||
if toolExec {
|
if toolExec {
|
||||||
|
exePath, err := os.Executable()
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
toolPath := filepath.Join("bin", runtime.GOOS, "zero-epwing")
|
toolPath := filepath.Join("bin", runtime.GOOS, "zero-epwing")
|
||||||
if runtime.GOOS == "windows" {
|
if runtime.GOOS == "windows" {
|
||||||
toolPath += ".exe"
|
toolPath += ".exe"
|
||||||
}
|
}
|
||||||
|
|
||||||
if toolPath, err = filepath.Abs(toolPath); err != nil {
|
toolPath = filepath.Join(filepath.Dir(exePath), toolPath)
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
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