fix: args is not iterable

This commit is contained in:
wxip 2024-05-24 15:28:35 +08:00
parent b4405eb7db
commit 4d754673e7
1 changed files with 14 additions and 12 deletions

View File

@ -13,6 +13,7 @@ export const joinCommand = (path, args = [], emptyContent = '-') => {
if (!isEmpty(path)) {
let containValuePlaceholder = false
cmd = includes(path, ' ') ? `"${path}"` : path
if (args) {
for (let part of args) {
part = trim(part)
if (isEmpty(part)) {
@ -28,6 +29,7 @@ export const joinCommand = (path, args = [], emptyContent = '-') => {
cmd += ' ' + part
}
}
}
if (!containValuePlaceholder) {
cmd += ' {VALUE}'
}