Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions pkg/cmd/plugin/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,13 @@
return plugin, version
}

func (ic *InstallCmd) installPluginByName(cmd *cobra.Command, arg string) error {
func (ic *InstallCmd) installPluginByName(cmd *cobra.Command, arg string) (version string, err error) {
pluginName, version := parseInstallArg(arg)

plugin, err := plugins.LookUpPlugin(cmd.Context(), ic.cfg, ic.fs, pluginName)

if err != nil {
return err
return version, err
}

if len(version) == 0 {
Expand All @@ -86,7 +86,7 @@

err = plugin.Install(ctx, ic.cfg, ic.fs, version, ic.apiBaseURL)

return err
return version, err
}

func (ic *InstallCmd) runInstallCmd(cmd *cobra.Command, args []string) error {
Expand All @@ -95,6 +95,7 @@
}

var err error
var version string
color := ansi.Color(os.Stdout)

// Refresh the plugin before proceeding
Expand All @@ -103,12 +104,15 @@
return err
}

err = ic.installPluginByName(cmd, args[0])
version, err = ic.installPluginByName(cmd, args[0])
if err != nil {
return err
}

fmt.Println(color.Green("✔ installation complete."))
if err == nil {

Check failure on line 112 in pkg/cmd/plugin/install.go

View workflow job for this annotation

GitHub Actions / test (1.26.0, ubuntu-latest)

nilness: tautological condition: nil == nil (govet)

Check failure on line 112 in pkg/cmd/plugin/install.go

View workflow job for this annotation

GitHub Actions / test (1.26.0, ubuntu-latest)

nilness: tautological condition: nil == nil (govet)
successMsg := fmt.Sprintf("✔ installation of v%s complete.", version)
fmt.Println(color.Green(successMsg))
}

return nil
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/plugins/RUNTIME.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ When a user installs a plugin with runtime requirements:
$ stripe plugin install generate
downloading Node.js v20.18.1 runtime...
installing 'generate' v1.0.0...
✔ installation complete.
✔ installation of 1.0.0 complete.
```

The runtime is:
Expand Down
Loading