Alejandro Mery
1 year ago
1 changed files with 27 additions and 0 deletions
@ -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…
Reference in new issue