wip
This commit is contained in:
parent
e9c176e31d
commit
00acc56076
@ -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":
|
||||
|
10
epwing.go
10
epwing.go
@ -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"
|
||||
|
Loading…
Reference in New Issue
Block a user