diff --git a/pkg/config/http.go b/pkg/config/http.go index 363a399..f6d9d35 100644 --- a/pkg/config/http.go +++ b/pkg/config/http.go @@ -87,7 +87,7 @@ func (c HTTP) call(ctx context.Context) error { return err } - if err := unarchive(dest); err != nil { + if err := unarchiveV2(dest); err != nil { return errors.Wrapf(err, "failed to unarchive: %s", dest) } @@ -125,6 +125,15 @@ func (c HTTP) Install(ctx context.Context, status chan<- Status) error { return errs.ErrorOrNil() } +func unarchiveV2(path string) error { + _, err := archiver.ByExtension(path) + if err != nil { + log.Printf("[DEBUG] unarchiveV2: no need to unarchive. finished with nil") + return nil + } + return archiver.Unarchive(path, filepath.Dir(path)) +} + func unarchive(f string) error { buf, err := ioutil.ReadFile(f) if err != nil {