Skip to content

Commit

Permalink
mirror: add tiup mirror show command to print current mirror address (
Browse files Browse the repository at this point in the history
  • Loading branch information
baurine authored Apr 19, 2021
1 parent 1d16f0d commit 31c26b2
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions cmd/mirror.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ of components or the repository itself.`,
newMirrorCloneCmd(),
newMirrorMergeCmd(),
newMirrorPublishCmd(),
newMirrorShowCmd(),
newMirrorSetCmd(),
newMirrorModifyCmd(),
newMirrorGrantCmd(),
Expand Down Expand Up @@ -139,6 +140,21 @@ func newMirrorSignCmd() *cobra.Command {
return cmd
}

// the `mirror show` sub command
func newMirrorShowCmd() *cobra.Command {
cmd := &cobra.Command{
Use: "show",
Short: "Show mirror address",
Long: `Show current mirror address`,
RunE: func(cmd *cobra.Command, args []string) error {
fmt.Println(environment.Mirror())
return nil
},
}

return cmd
}

// the `mirror set` sub command
func newMirrorSetCmd() *cobra.Command {
var (
Expand Down

0 comments on commit 31c26b2

Please sign in to comment.