mirror of
https://github.com/tiny-craft/tiny-rdm.git
synced 2025-04-23 06:18:05 +08:00
fix: args is not iterable
This commit is contained in:
parent
b4405eb7db
commit
4d754673e7
@ -13,19 +13,21 @@ export const joinCommand = (path, args = [], emptyContent = '-') => {
|
||||
if (!isEmpty(path)) {
|
||||
let containValuePlaceholder = false
|
||||
cmd = includes(path, ' ') ? `"${path}"` : path
|
||||
for (let part of args) {
|
||||
part = trim(part)
|
||||
if (isEmpty(part)) {
|
||||
continue
|
||||
}
|
||||
if (includes(part, ' ')) {
|
||||
cmd += ' "' + part + '"'
|
||||
} else {
|
||||
if (toUpper(part) === '{VALUE}') {
|
||||
part = '{VALUE}'
|
||||
containValuePlaceholder = true
|
||||
if (args) {
|
||||
for (let part of args) {
|
||||
part = trim(part)
|
||||
if (isEmpty(part)) {
|
||||
continue
|
||||
}
|
||||
if (includes(part, ' ')) {
|
||||
cmd += ' "' + part + '"'
|
||||
} else {
|
||||
if (toUpper(part) === '{VALUE}') {
|
||||
part = '{VALUE}'
|
||||
containValuePlaceholder = true
|
||||
}
|
||||
cmd += ' ' + part
|
||||
}
|
||||
cmd += ' ' + part
|
||||
}
|
||||
}
|
||||
if (!containValuePlaceholder) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user