fixes for windoze
This commit is contained in:
parent
055d0e4818
commit
354fc32608
12
epwing.go
12
epwing.go
@ -69,14 +69,20 @@ func epwingExportDb(inputPath, outputDir, title string, stride int, pretty bool)
|
|||||||
var data []byte
|
var data []byte
|
||||||
if stat.IsDir() {
|
if stat.IsDir() {
|
||||||
toolPath := filepath.Join(
|
toolPath := filepath.Join(
|
||||||
filepath.Dir(os.Args[0]),
|
|
||||||
"bin",
|
"bin",
|
||||||
runtime.GOOS,
|
runtime.GOOS,
|
||||||
"zero-epwing",
|
"zero-epwing",
|
||||||
)
|
)
|
||||||
|
|
||||||
_, err := os.Stat(toolPath)
|
if runtime.GOOS == "windows" {
|
||||||
if err != nil {
|
toolPath += ".exe"
|
||||||
|
}
|
||||||
|
|
||||||
|
if toolPath, err = filepath.Abs(toolPath); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
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