Embed and unpack the key if it's not present either

This commit is contained in:
idk
2022-01-23 13:40:14 -05:00
parent 5bc7752255
commit 2ee490a077
3 changed files with 25 additions and 6 deletions

View File

@ -1,6 +1,7 @@
package tbserve
import (
"embed"
"encoding/json"
"fmt"
"io/ioutil"
@ -20,11 +21,12 @@ type Client struct {
TBS *TBSupervise.Supervisor
}
func NewClient(hostname string, lang string, os string, arch string) (*Client, error) {
func NewClient(hostname string, lang string, os string, arch string, content *embed.FS) (*Client, error) {
m := &Client{
hostname: hostname,
TBD: tbget.NewTBDownloader(lang, os, arch),
TBD: tbget.NewTBDownloader(lang, os, arch, content),
}
m.TBD.MakeTBDirectory()
tgz, sig, err := m.TBD.DownloadUpdaterForLang(lang)
if err != nil {
panic(err)