add comments
Some checks failed
ci/woodpecker/push/go-lint Pipeline failed

This commit is contained in:
Andrew Woodlee 2025-01-23 16:47:43 -06:00
parent 8c633fd4b2
commit 5d3c265ce9

View File

@ -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)