1

Merge pull request #21 from playHing/normal-flow

Fix the path to get zero-epwing
This commit is contained in:
Alex Yatskov 2020-03-06 17:41:41 -08:00 committed by GitHub
commit fc189b9b83
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -78,14 +78,17 @@ func epwingExportDb(inputPath, outputPath, language, title string, stride int, p
var data []byte
if toolExec {
exePath, err := os.Executable()
if err != nil {
return err
}
toolPath := filepath.Join("bin", runtime.GOOS, "zero-epwing")
if runtime.GOOS == "windows" {
toolPath += ".exe"
}
if toolPath, err = filepath.Abs(toolPath); err != nil {
return err
}
toolPath = filepath.Join(filepath.Dir(exePath), toolPath)
if _, err = os.Stat(toolPath); err != nil {
return fmt.Errorf("failed to find zero-epwing in '%s'", toolPath)