feat: add --format json support to plugin:list
Adds a `--format json` flag to `plugin:list` whose output includes each plugin's install source - for git-based third-party plugins, the git remote URL, the checked-out commit, and the followed branch - so the set of installed plugins can be reconstructed elsewhere. Closes #8798.
This commit is contained in:
20
plugins/plugin/src/plugin-list/plugin-list.go
Normal file
20
plugins/plugin/src/plugin-list/plugin-list.go
Normal file
@@ -0,0 +1,20 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"os"
|
||||
|
||||
"github.com/dokku/dokku/plugins/common"
|
||||
"github.com/dokku/dokku/plugins/plugin"
|
||||
|
||||
flag "github.com/spf13/pflag"
|
||||
)
|
||||
|
||||
func main() {
|
||||
args := flag.NewFlagSet("plugin:list", flag.ExitOnError)
|
||||
format := args.String("format", "json", "format: [ json ]")
|
||||
args.Parse(os.Args[1:])
|
||||
|
||||
if err := plugin.CommandList(*format); err != nil {
|
||||
common.LogFailWithError(err)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user