ignore missing esoui info

master v0.0.1
JoYo 2024-06-07 21:19:30 -04:00
parent 25dd9f17b0
commit a5b4585a44
3 changed files with 32 additions and 5 deletions

1
.gitignore vendored
View File

@ -3,3 +3,4 @@
*.sum
live/
*.list
*.zip

View File

@ -1,4 +1,4 @@
EXEs=banana.elf
EXEs=banana.elf banana.exe
all: tidy clean ${EXEs}
@ -8,12 +8,15 @@ tidy:
banana.elf:
go build -o banana.elf banana.go
banana.exe:
GOOS=windows go build -o banana.exe banana.go
clean:
go clean
-rm ${EXEs}
run:
go run banana.go -h
go run banana.go -i live/addons.list -o live/AddOns/
install:
GOBIN=~/.local/bin/ go install banana.go

View File

@ -229,9 +229,26 @@ func eso_ui_stat_init(addon_url string) (EsoAddon, error) {
return EsoAddon{}, error
}
name := ESOUI_NAME.FindStringSubmatch(addon_url)[1]
version := ESOUI_VERSION.FindStringSubmatch(string(addon_body))[1]
var name string
names := ESOUI_NAME.FindStringSubmatch(addon_url)
if len(names) > 1 {
name = names[1]
} else {
name = ""
}
var version string
versions := ESOUI_VERSION.FindStringSubmatch(string(addon_body))
if len(versions) > 1 {
version = versions[1]
} else {
version = ""
}
path := string(ESOUI_DOWNLOAD.Find(download_body))
if path == "" {
return EsoAddon{}, errors.New("Download URI missing " + addon_url)
}
return EsoAddon{name, version, path}, nil
}
@ -244,7 +261,13 @@ func eso_live_stat_init(eso_live_name string) (EsoAddon, error) {
return EsoAddon{}, error
}
version := LIVE_VERSION.FindStringSubmatch(string(content))[1]
var version string
versions := LIVE_VERSION.FindStringSubmatch(string(content))
if len(versions) > 1 {
version = versions[1]
} else {
version = ""
}
return EsoAddon{eso_live_name, version, path}, nil
}