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:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user