mirror of
https://git.mirrors.martin98.com/https://github.com/actions/toolkit
synced 2026-05-04 18:58:07 +08:00
remove trailing comma from commands (#263)
This commit is contained in:
@@ -51,13 +51,20 @@ class Command {
|
||||
|
||||
if (this.properties && Object.keys(this.properties).length > 0) {
|
||||
cmdStr += ' '
|
||||
let first = true
|
||||
for (const key in this.properties) {
|
||||
if (this.properties.hasOwnProperty(key)) {
|
||||
const val = this.properties[key]
|
||||
if (val) {
|
||||
if (first) {
|
||||
first = false
|
||||
} else {
|
||||
cmdStr += ','
|
||||
}
|
||||
|
||||
// safely append the val - avoid blowing up when attempting to
|
||||
// call .replace() if message is not a string for some reason
|
||||
cmdStr += `${key}=${escape(`${val || ''}`)},`
|
||||
cmdStr += `${key}=${escape(`${val || ''}`)}`
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user