You've already forked armbian-router
mirror of
https://github.com/armbian/armbian-router.git
synced 2026-01-06 10:37:03 -08:00
add support for some special cases
This commit is contained in:
13
map.go
13
map.go
@@ -4,13 +4,14 @@ import (
|
||||
"encoding/csv"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"io"
|
||||
"net/url"
|
||||
"os"
|
||||
"path"
|
||||
"strings"
|
||||
|
||||
log "github.com/sirupsen/logrus"
|
||||
|
||||
"golang.org/x/text/cases"
|
||||
"golang.org/x/text/language"
|
||||
)
|
||||
@@ -130,6 +131,16 @@ func loadMapJSON(f io.Reader) (map[string]string, error) {
|
||||
sb.WriteString(file.Preinstalled)
|
||||
}
|
||||
|
||||
// Check special case for some extensions
|
||||
switch {
|
||||
case strings.HasSuffix(file.Extension, "boot-boe.img.xz"):
|
||||
sb.WriteString("-boot-boe")
|
||||
case strings.HasSuffix(file.Extension, "boot-csot.img.xz"):
|
||||
sb.WriteString("-boot-csot")
|
||||
case strings.HasSuffix(file.Extension, "rootfs.img.xz"):
|
||||
sb.WriteString("-rootfs")
|
||||
}
|
||||
|
||||
if strings.HasSuffix(file.Extension, "img.xz") {
|
||||
m[sb.String()] = u.Path
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user