Skip to content

Commit

Permalink
version: hide extra info under --verbose flag
Browse files Browse the repository at this point in the history
  • Loading branch information
thdxr committed Aug 15, 2024
1 parent 074fb87 commit 5324893
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 14 deletions.
15 changes: 1 addition & 14 deletions cmd/sst/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import (
"time"

"github.com/nrednav/cuid2"
"github.com/pulumi/pulumi/sdk/v3"

"github.com/briandowns/spinner"
"github.com/fatih/color"
Expand Down Expand Up @@ -1070,19 +1069,7 @@ var root = &cli.Command{
return nil
},
},
{
Name: "version",
Description: cli.Description{
Short: "Print the version of the CLI",
Long: `Prints the current version of the CLI.`,
},
Run: func(cli *cli.Cli) error {
fmt.Println("sst", version)
fmt.Println("pulumi", sdk.Version)
fmt.Println("config", global.ConfigDir())
return nil
},
},
CmdVersion,
{
Name: "upgrade",
Description: cli.Description{
Expand Down
25 changes: 25 additions & 0 deletions cmd/sst/version.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package main

import (
"fmt"

"github.com/pulumi/pulumi/sdk/v3"
"github.com/sst/ion/cmd/sst/cli"
"github.com/sst/ion/pkg/global"
)

var CmdVersion = &cli.Command{
Name: "version",
Description: cli.Description{
Short: "Print the version of the CLI",
Long: `Prints the current version of the CLI.`,
},
Run: func(cli *cli.Cli) error {
fmt.Println("sst", version)
if cli.Bool("verbose") {
fmt.Println("pulumi", sdk.Version)
fmt.Println("config", global.ConfigDir())
}
return nil
},
}

0 comments on commit 5324893

Please sign in to comment.