Skip to content

Commit

Permalink
Merge pull request #287 from Bedrock-OSS/move-data-copy
Browse files Browse the repository at this point in the history
Move copying data before installing dependencies
  • Loading branch information
Nusiq authored Jun 22, 2024
2 parents 3858302 + ca7138e commit 46d6238
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 3 additions & 1 deletion regolith/filter_remote.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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)
Expand Down
4 changes: 1 addition & 3 deletions regolith/install_add.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 46d6238

Please sign in to comment.