Skip to content

Commit

Permalink
just because
Browse files Browse the repository at this point in the history
  • Loading branch information
ldez committed Jun 2, 2023
1 parent 5e89fc2 commit 8667929
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions pkg/plugins/plugins.go
Expand Up @@ -21,7 +21,7 @@ func SetupRemotePlugins(client *Client, plugins map[string]Descriptor) error {

err = client.CleanArchives(plugins)
if err != nil {
return fmt.Errorf("failed to clean archives: %w", err)
return fmt.Errorf("unable to clean archives: %w", err)
}

ctx := context.Background()
Expand All @@ -32,27 +32,27 @@ func SetupRemotePlugins(client *Client, plugins map[string]Descriptor) error {
hash, err := client.Download(ctx, desc.ModuleName, desc.Version)
if err != nil {
_ = client.ResetAll()
return fmt.Errorf("failed to download plugin %s: %w", desc.ModuleName, err)
return fmt.Errorf("unable to download plugin %s: %w", desc.ModuleName, err)
}

err = client.Check(ctx, desc.ModuleName, desc.Version, hash)
if err != nil {
_ = client.ResetAll()
return fmt.Errorf("failed to check archive integrity of the plugin %s: %w", desc.ModuleName, err)
return fmt.Errorf("unable to check archive integrity of the plugin %s: %w", desc.ModuleName, err)
}
}

err = client.WriteState(plugins)
if err != nil {
_ = client.ResetAll()
return fmt.Errorf("failed to write plugins state: %w", err)
return fmt.Errorf("unable to write plugins state: %w", err)
}

for _, desc := range plugins {
err = client.Unzip(desc.ModuleName, desc.Version)
if err != nil {
_ = client.ResetAll()
return fmt.Errorf("failed to unzip archive: %w", err)
return fmt.Errorf("unable to unzip archive: %w", err)
}
}

Expand Down

0 comments on commit 8667929

Please sign in to comment.