From 5d3c265ce9c92d64c44b3d17e3871d6b8a4674b3 Mon Sep 17 00:00:00 2001 From: Andrew Woodlee Date: Thu, 23 Jan 2025 16:47:43 -0600 Subject: [PATCH] add comments --- pkg/backy/backy.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pkg/backy/backy.go b/pkg/backy/backy.go index d274dce..42986ea 100644 --- a/pkg/backy/backy.go +++ b/pkg/backy/backy.go @@ -34,15 +34,17 @@ var Sprintf = fmt.Sprintf func (command *Command) RunCmd(cmdCtxLogger zerolog.Logger, opts *ConfigOpts) ([]string, error) { var ( - outputArr []string - ArgsStr string + ArgsStr string // concatenating the arguments cmdOutBuf bytes.Buffer cmdOutWriters io.Writer + errSSH error envVars = environmentVars{ file: command.Env, env: command.Environment, } + + outputArr []string // holds the output strings returned by processes ) // Get the command type @@ -53,13 +55,13 @@ func (command *Command) RunCmd(cmdCtxLogger zerolog.Logger, opts *ConfigOpts) ([ ArgsStr += fmt.Sprintf(" %s", v) } + // print the user's password if it is updated if command.Type == "user" { if command.UserOperation == "password" { cmdCtxLogger.Info().Str("password", command.UserPassword).Msg("user password to be updated") } } - var errSSH error // is host defined if command.Host != nil { outputArr, errSSH = command.RunCmdSSH(cmdCtxLogger, opts)