1
This commit is contained in:
Alex Yatskov 2017-06-25 18:29:53 -07:00
parent e9c176e31d
commit 00acc56076
3 changed files with 10 additions and 8 deletions

View File

@ -234,9 +234,7 @@ func hasString(needle string, haystack []string) bool {
}
func detectFormat(path string) (string, error) {
base := filepath.Base(path)
fmt.Print(base)
switch base {
switch filepath.Base(path) {
case "JMdict", "JMdict.xml", "JMdict_e", "JMdict_e.xml":
return "edict", nil
case "JMnedict", "JMnedict.xml":

View File

@ -68,8 +68,16 @@ func epwingExportDb(inputPath, outputPath, language, title string, stride int, p
return err
}
var data []byte
var toolExec bool
if stat.IsDir() {
toolExec = true
} else if filepath.Base(inputPath) == "CATALOGS" {
inputPath = filepath.Dir(inputPath)
toolExec = true
}
var data []byte
if toolExec {
toolPath := filepath.Join("bin", runtime.GOOS, "zero-epwing")
if runtime.GOOS == "windows" {
toolPath += ".exe"

4
gui.go
View File

@ -122,10 +122,6 @@ func gui() error {
return
}
if format == "epwing" {
inputPath = filepath.Dir(inputPath)
}
title := titleEntry.Text()
language := languageEntry.Text()