Commit 5b547b2 1 parent bf105c7 commit 5b547b2 Copy full SHA for 5b547b2
File tree 2 files changed +10
-2
lines changed
2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ package main
2
2
3
3
import (
4
4
"github.com/spf13/cobra"
5
+ "github.com/wttech/aemc/pkg"
5
6
)
6
7
7
8
func (c * CLI ) vaultCmd () * cobra.Command {
@@ -10,17 +11,19 @@ func (c *CLI) vaultCmd() *cobra.Command {
10
11
Short : "Executes Vault commands" ,
11
12
Run : func (cmd * cobra.Command , args []string ) {
12
13
if err := c .aem .VendorManager ().VaultCLI ().CommandShell (args ); err != nil {
13
- c .Error ( err )
14
+ c .Fail ( "command failed" )
14
15
return
15
16
}
17
+ c .Ok ("command run" )
16
18
},
17
19
Args : cobra .ArbitraryArgs ,
18
20
FParseErrWhitelist : cobra.FParseErrWhitelist {
19
21
UnknownFlags : true ,
20
22
},
21
23
}
22
24
cmd .SetHelpFunc (func (cmd * cobra.Command , args []string ) {
23
- _ = c .aem .VendorManager ().VaultCLI ().CommandShell (args )
25
+ aem := pkg .NewAEM (c .config ) // c.onStart() not yet called
26
+ _ = aem .VendorManager ().VaultCLI ().CommandShell (args [1 :])
24
27
})
25
28
return cmd
26
29
}
Original file line number Diff line number Diff line change @@ -105,6 +105,11 @@ func (v VaultCLI) CommandShell(args []string) error {
105
105
}
106
106
vaultCliArgs := append ([]string {v .VltFile ()}, args ... )
107
107
cmd := execx .CommandShell (vaultCliArgs )
108
+ env , err := v .vendorManager .JavaManager ().Env ()
109
+ if err != nil {
110
+ return err
111
+ }
112
+ cmd .Env = env
108
113
v .vendorManager .aem .CommandOutput (cmd )
109
114
if err = cmd .Run (); err != nil {
110
115
return fmt .Errorf ("cannot run Vault command: %w" , err )
You can’t perform that action at this time.
0 commit comments