Skip to content

Commit 96f5363

Browse files
toratoraMark Knasiak
andauthored
'kill' and 'file push' command json output changes (#678)
* include pid field in kill command JSON output for parity with launch command * have 'file push' command respect --nojson flag * include pid field in kill command JSON output for parity with launch command * have 'file push' command respect --nojson flag * use interface{} instead of any for consistency with rest of code --------- Co-authored-by: Mark Knasiak <[email protected]>
1 parent 0427f8d commit 96f5363

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

main.go

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1123,9 +1123,9 @@ The commands work as following:
11231123
err = pControl.KillProcess(p.Pid)
11241124
exitIfError("kill process failed ", err)
11251125
if bundleID != "" {
1126-
log.Info(bundleID, " killed, Pid: ", p.Pid)
1126+
log.WithFields(log.Fields{"pid": p.Pid}).Info(bundleID, " killed, Pid: ", p.Pid)
11271127
} else {
1128-
log.Info(p.Name, " killed, Pid: ", p.Pid)
1128+
log.WithFields(log.Fields{"pid": p.Pid}).Info(p.Name, " killed, Pid: ", p.Pid)
11291129
}
11301130
return
11311131
}
@@ -1437,12 +1437,11 @@ The commands work as following:
14371437
err = conn.PushFile(remotePath, file, fileSize, permissions, uid, gid)
14381438
exitIfError("push: failed to upload file", err)
14391439

1440-
if b, _ := arguments.Bool("--json"); b {
1440+
if !JSONdisabled {
14411441
result := map[string]interface{}{
1442-
"success": true,
1443-
"remote": remotePath,
1444-
"local": localPath,
1445-
"size": fileSize,
1442+
"remote": remotePath,
1443+
"local": localPath,
1444+
"size": fileSize,
14461445
}
14471446
fmt.Println(convertToJSONString(result))
14481447
} else {

0 commit comments

Comments
 (0)