diff --git a/cmd/where.go b/cmd/where.go new file mode 100644 index 00000000..ecda6199 --- /dev/null +++ b/cmd/where.go @@ -0,0 +1,22 @@ +package cmd + +import ( + "fmt" + + "github.com/spf13/cobra" +) + +var WhereCmd = &cobra.Command{ + Use: "where", + Short: "Find where your cloud.charm.sh folder resides on your machine", + Long: paragraph("Find the absolute path to your charm keys, databases, etc."), + RunE: func(cmd *cobra.Command, args []string) error { + cc := initCharmClient() + path, err := cc.DataPath() + if err != nil { + return err + } + fmt.Fprintln(cmd.OutOrStdout(), path) + return nil + }, +} diff --git a/main.go b/main.go index a1821707..34141bc4 100644 --- a/main.go +++ b/main.go @@ -101,6 +101,7 @@ func init() { cmd.FSCmd, cmd.CryptCmd, cmd.MigrateAccountCmd, + cmd.WhereCmd, manCmd, ) }