1

Get current file path

This commit is contained in:
playHing 2020-02-22 15:23:45 +08:00
parent c772b4a826
commit 5892e4f8b6

View File

@ -78,14 +78,17 @@ func epwingExportDb(inputPath, outputPath, language, title string, stride int, p
var data []byte
if toolExec {
ex, err := os.Executable()
if err != nil {
panic(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(ex), toolPath)
if _, err = os.Stat(toolPath); err != nil {
return fmt.Errorf("failed to find zero-epwing in '%s'", toolPath)