fix #18: support upper case extension

This commit is contained in:
Emmm Monster
2021-11-11 23:27:07 +08:00
parent 0a13671df2
commit 6fd5bd5863
3 changed files with 14 additions and 7 deletions

View File

@ -76,8 +76,7 @@ func appMain(c *cli.Context) error {
if inputStat.IsDir() {
return dealDirectory(input, output)
} else {
ext := strings.TrimLeft(filepath.Ext(inputStat.Name()), ".")
allDec := common.GetDecoder(ext)
allDec := common.GetDecoder(inputStat.Name())
if len(allDec) == 0 {
logging.Log().Fatal("skipping while no suitable decoder")
}
@ -94,8 +93,7 @@ func dealDirectory(inputDir string, outputDir string) error {
if item.IsDir() {
continue
}
ext := strings.TrimLeft(filepath.Ext(item.Name()), ".")
allDec := common.GetDecoder(ext)
allDec := common.GetDecoder(item.Name())
if len(allDec) == 0 {
logging.Log().Info("skipping while no suitable decoder", zap.String("file", item.Name()))
continue