feat: cli

This commit is contained in:
liwei committed 2021-03-25 17:30:40 +08:00
1 parent caf9bf265b
commit 359f28bb1f
12 files changed
+209 -97

No files matched your search

+3 -2
View File
@@ -16,6 +16,7 @@ import (
"path"
"path/filepath"
"strconv"
"strings"
"time"
)
@@ -117,8 +118,8 @@ func (f *Fetcher) Resolve(req *base.Request) (*base.Resource, error) {
}
}
// Get file filename by URL
if file.Name == "" {
file.Name = path.Base(req.URL)
if file.Name == "" && strings.Count(req.URL, "/") > 2 {
file.Name = filepath.Base(req.URL)
}
// unknown file filename
if file.Name == "" {