Skip to content
Merged
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
5 changes: 1 addition & 4 deletions app/cli/cmd/plugins.go
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,6 @@ func newPluginDescribeCmd() *cobra.Command {

func newPluginInstallCmd() *cobra.Command {
var file string
var filename string
var location string

cmd := &cobra.Command{
Expand All @@ -257,7 +256,6 @@ func newPluginInstallCmd() *cobra.Command {

opts := &action.PluginInstallOptions{
File: file,
Filename: filename,
Location: location,
}

Expand All @@ -272,8 +270,7 @@ func newPluginInstallCmd() *cobra.Command {
}

// Common flags
cmd.Flags().StringVarP(&file, "file", "f", "", "URL of the plugin to download (required)")
cmd.Flags().StringVarP(&filename, "filename", "", "", "Custom filename to save the plugin as (optional)")
cmd.Flags().StringVarP(&file, "file", "f", "", "URL or path to the plugin to install")
cobra.CheckErr(cmd.MarkFlagRequired("file"))

return cmd
Expand Down
5 changes: 2 additions & 3 deletions app/cli/documentation/cli-reference.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -1281,9 +1281,8 @@ chainloop config plugin install [flags]
Options

```
-f, --file string URL of the plugin to download (required)
--filename string Custom filename to save the plugin as (optional)
-h, --help help for install
-f, --file string URL or path to the plugin to install
-h, --help help for install
```

Options inherited from parent commands
Expand Down
5 changes: 1 addition & 4 deletions app/cli/internal/action/plugin_actions.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,10 +172,7 @@ func (action *PluginInstall) Run(_ context.Context, opts *PluginInstallOptions)

// determine filename
filename := filepath.Base(opts.File)
if opts.Filename != "" {
filename = opts.Filename
action.cfg.Logger.Debug().Str("customFilename", opts.Filename).Msg("Using custom filename")
} else if filename == "." || filename == "/" {
if filename == "." || filename == "/" {
action.cfg.Logger.Error().Str("file", opts.File).Msg("Invalid URL or object key, could not determine filename")
return nil, fmt.Errorf("invalid URL or object key, could not determine filename")
}
Expand Down
Loading