load hub file properly when restoring config from tmpdir (#847)

This commit is contained in:
Thibault "bui" Koechlin 2021-07-01 18:38:45 +02:00 committed by GitHub
parent 033c8e17e8
commit ca3e9ea487
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -535,6 +535,13 @@ func silenceInstallItem(name string, obtype string) (string, error) {
func RestoreHub(dirPath string) error {
var err error
if err := csConfig.LoadHub(); err != nil {
return err
}
if err := setHubBranch(); err != nil {
return fmt.Errorf("error while setting hub branch: %s", err)
}
for _, itype := range cwhub.ItemTypes {
itemDirectory := fmt.Sprintf("%s/%s/", dirPath, itype)
if _, err = os.Stat(itemDirectory); err != nil {