Add downloading of main components, fix dir permissions

Fixes #2, #3
This commit is contained in:
Daniel
2019-07-04 13:54:51 +02:00
parent 9636777b30
commit 5b80a0b95e
7 changed files with 67 additions and 56 deletions

View File

@@ -62,6 +62,7 @@ func LoadLatest() error {
return nil
}
// ScanForLatest scan the local update directory and returns a map of the latest/newest component versions.
func ScanForLatest(baseDir string, hardFail bool) (latest map[string]string, lastError error) {
var added int
latest = make(map[string]string)
@@ -117,6 +118,7 @@ func ScanForLatest(baseDir string, hardFail bool) (latest map[string]string, las
return latest, nil
}
// LoadIndexes loads the current update indexes from disk.
func LoadIndexes() error {
data, err := ioutil.ReadFile(filepath.Join(updateStoragePath, "stable.json"))
if err != nil {