mirror of
https://github.com/passbolt/go-passbolt-cli.git
synced 2025-05-11 10:38:21 +00:00
wip 4
This commit is contained in:
parent
8ae52363cc
commit
a9be6c1670
1 changed files with 5 additions and 5 deletions
10
cmd/exec.go
10
cmd/exec.go
|
@ -45,16 +45,16 @@ func execAction(_ *cobra.Command, args []string) error {
|
|||
|
||||
client, err := util.GetClient(ctx)
|
||||
if err != nil {
|
||||
return fmt.Errorf("error creating client: %w", err)
|
||||
return fmt.Errorf("creating client: %w", err)
|
||||
}
|
||||
|
||||
envVars, err := resolveEnvironmentSecrets(ctx, client)
|
||||
if err != nil {
|
||||
return fmt.Errorf("error resolving secrets: %w", err)
|
||||
return fmt.Errorf("resolving secrets: %w", err)
|
||||
}
|
||||
|
||||
if err = client.Logout(ctx); err != nil {
|
||||
return fmt.Errorf("error logging out client: %w", err)
|
||||
return fmt.Errorf("logging out client: %w", err)
|
||||
}
|
||||
|
||||
subCmd := exec.Command(args[0], args[1:]...)
|
||||
|
@ -64,7 +64,7 @@ func execAction(_ *cobra.Command, args []string) error {
|
|||
subCmd.Env = envVars
|
||||
|
||||
if err = subCmd.Run(); err != nil {
|
||||
return fmt.Errorf("error running command: %w", err)
|
||||
return fmt.Errorf("running command: %w", err)
|
||||
}
|
||||
|
||||
return nil
|
||||
|
@ -89,7 +89,7 @@ func resolveEnvironmentSecrets(ctx context.Context, client *api.Client) ([]strin
|
|||
resourceId := strings.TrimPrefix(value, PassboltPrefix)
|
||||
_, _, _, _, secret, _, err := helper.GetResource(ctx, client, resourceId)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error getting resource: %w", err)
|
||||
return nil, fmt.Errorf("getting resource: %w", err)
|
||||
}
|
||||
|
||||
envVars[i] = key + "=" + secret
|
||||
|
|
Loading…
Add table
Reference in a new issue