Browse Source

jpictl: introduce `env` command

Signed-off-by: Alejandro Mery <amery@jpi.io>
pull/1/head v0.1.0
Alejandro Mery 1 year ago
parent
commit
0c0cba6fb5
  1. 27
      cmd/jpictl/env.go

27
cmd/jpictl/env.go

@ -0,0 +1,27 @@
package main
import (
"os"
"github.com/spf13/cobra"
"git.jpi.io/amery/jpictl/pkg/zones"
)
// Command
var envCmd = &cobra.Command{
Use: "env",
Short: "generates environment variables for shell scripts",
RunE: func(_ *cobra.Command, _ []string) error {
m, err := zones.New(cfg.Base, cfg.Domain)
if err != nil {
return err
}
return m.WriteEnv(os.Stdout)
},
}
func init() {
rootCmd.AddCommand(envCmd)
}
Loading…
Cancel
Save