You've already forked armbian-router
mirror of
https://github.com/armbian/armbian-router.git
synced 2026-01-06 10:37:03 -08:00
11
map.go
11
map.go
@@ -13,6 +13,7 @@ import (
|
||||
"golang.org/x/text/language"
|
||||
)
|
||||
|
||||
// ErrUnsupportedFormat is returned when an unsupported map format is used.
|
||||
var ErrUnsupportedFormat = errors.New("unsupported map format")
|
||||
|
||||
// loadMapFile loads a file as a map
|
||||
@@ -120,16 +121,18 @@ func loadMapJSON(f io.Reader) (map[string]string, error) {
|
||||
|
||||
sb.WriteString(".")
|
||||
|
||||
if file.Extension == "img.xz.sha" {
|
||||
if strings.HasSuffix(file.Extension, ".sha") {
|
||||
sb.WriteString("sha")
|
||||
} else if file.Extension == "img.xz.asc" {
|
||||
} else if strings.HasSuffix(file.Extension, ".asc") {
|
||||
sb.WriteString("asc")
|
||||
} else if strings.HasSuffix(file.Extension, ".torrent") {
|
||||
sb.WriteString("torrent")
|
||||
} else {
|
||||
sb.WriteString(file.Extension)
|
||||
}
|
||||
|
||||
builtUri := sb.String()
|
||||
m[builtUri] = file.FileURL
|
||||
builtURI := sb.String()
|
||||
m[builtURI] = file.FileURL
|
||||
}
|
||||
|
||||
return m, nil
|
||||
|
||||
Reference in New Issue
Block a user