Get current file path
This commit is contained in:
parent
c772b4a826
commit
5892e4f8b6
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user