Improvements to field generation (#137)

* Remove `no-embedded-types` flag

We don't use this.

* Use `fw-download.ubnt.com`

* Return firmware download URL from `latestUnifiVersion`

* Don't use version metadata
This commit is contained in:
Joshua Spence
2023-05-26 15:29:07 +10:00
committed by GitHub
parent 93d9584462
commit 97b562a6d2
6 changed files with 180 additions and 197 deletions

View File

@@ -8,21 +8,19 @@ import (
"fmt"
"io"
"net/http"
"net/url"
"os"
"path"
"path/filepath"
"strings"
"github.com/hashicorp/go-version"
"github.com/iancoleman/strcase"
"github.com/ulikunitz/xz"
"github.com/xor-gate/ar"
)
func downloadJar(version *version.Version, outputDir string) (string, error) {
url := fmt.Sprintf("https://dl.ui.com/unifi/%s/unifi_sysvinit_all.deb", version)
debResp, err := http.Get(url)
func downloadJar(url *url.URL, outputDir string) (string, error) {
debResp, err := http.Get(url.String())
if err != nil {
return "", fmt.Errorf("unable to download deb: %w", err)
}