diff --git a/def.go b/def.go index 5aaecd6..e298c96 100644 --- a/def.go +++ b/def.go @@ -76,5 +76,20 @@ type Resource struct { *FileInfo } func (r Resource) getFileName() string { - return fmt.Sprintf("%s.%s", r.metaId, r.metaFileExt) + var fileName string + if /*len(r.metaFileExt) > 0*/false { + fileName = fmt.Sprintf("%s.%s", r.metaId, r.metaFileExt) + } else { + resPath := path.Join(*SrcPath, "resources") + c, err := ioutil.ReadDir(resPath) + CheckError(err) + for _, entry := range c { + if entry.IsDir() {continue} + if strings.Index(entry.Name(), r.metaId) >=0 { + fileName = entry.Name() + break + } + } + } + return fileName } diff --git a/main.go b/main.go index bc4dd64..1a3c92f 100644 --- a/main.go +++ b/main.go @@ -65,7 +65,7 @@ func main() { }() <-done - fmt.Println("\n\nDone!\n") + fmt.Printf("\n\nDone!\n\n") fmt.Println(fmt.Sprintf("The next step is to open %s as vault in Obsidian, Then you will see what you want to see.", *DestPath)) }