From ca7138e587a3d8cd0989d829909788eb3ec2a688 Mon Sep 17 00:00:00 2001 From: stirante Date: Tue, 11 Jun 2024 17:03:29 +0200 Subject: [PATCH] Move copying data before installing dependencies --- regolith/filter_remote.go | 4 +++- regolith/install_add.go | 4 +--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/regolith/filter_remote.go b/regolith/filter_remote.go index fb1f8e15..66bfeb14 100644 --- a/regolith/filter_remote.go +++ b/regolith/filter_remote.go @@ -547,7 +547,7 @@ func (f *RemoteFilterDefinition) InstalledVersion(dotRegolithPath string) (strin return versionStr, nil } -func (f *RemoteFilterDefinition) Update(force bool, dotRegolithPath string, refreshFilters bool) error { +func (f *RemoteFilterDefinition) Update(force bool, dotRegolithPath, dataPath string, refreshFilters bool) error { installedVersion, err := f.InstalledVersion(dotRegolithPath) installedVersion = trimFilterPrefix(installedVersion, f.Id) if err != nil && force { @@ -569,6 +569,8 @@ func (f *RemoteFilterDefinition) Update(force bool, dotRegolithPath string, refr if err != nil { return burrito.PassError(err) } + // Copy the data of the remote filter to the data path + f.CopyFilterData(dataPath, dotRegolithPath) err = f.InstallDependencies(f, dotRegolithPath) if err != nil { return burrito.PassError(err) diff --git a/regolith/install_add.go b/regolith/install_add.go index a0a62b71..3127f690 100644 --- a/regolith/install_add.go +++ b/regolith/install_add.go @@ -48,12 +48,10 @@ func installFilters( Logger.Infof("Downloading %q filter...", name) if remoteFilter, ok := filterDefinition.(*RemoteFilterDefinition); ok { // Download the remote filter, and its dependencies - err := remoteFilter.Update(force, dotRegolithPath, refreshFilters) + err := remoteFilter.Update(force, dotRegolithPath, dataPath, refreshFilters) if err != nil { return burrito.WrapErrorf(err, remoteFilterDownloadError, name) } - // Copy the data of the remote filter to the data path - remoteFilter.CopyFilterData(dataPath, dotRegolithPath) } else { // Non-remote filters must always update their dependencies. // TODO - add option to track if the filter already installed