jpictl: introduce env command
Signed-off-by: Alejandro Mery <amery@jpi.io>
This commit is contained in:
@@ -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)
|
||||
}
|
||||
Reference in New Issue
Block a user