Compare commits

...

2 Commits

Author SHA1 Message Date
amery 502e1b5264 pkg/zones: WIP
Signed-off-by: Alejandro Mery <amery@jpi.io>
2023-08-21 17:52:12 +00:00
amery 5cd55456f2 jpictl: initial env command [WIP]
Signed-off-by: Alejandro Mery <amery@jpi.io>
2023-08-21 17:52:12 +00:00
2 changed files with 38 additions and 0 deletions
+27
View File
@@ -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("./m")
if err != nil {
return err
}
return m.WriteEnv(os.Stdout)
},
}
func int() {
rootCmd.AddCommand(envCmd)
}
+11
View File
@@ -0,0 +1,11 @@
package zones
import "io"
type Zones struct{}
func (*Zones) WriteEnv(io.Writer) error {
return nil
}
func New(mdir string) (*Zones, error)