Skip to content
This repository was archived by the owner on May 8, 2024. It is now read-only.

Commit b8cb4c0

Browse files
fix: add quotes to inputs value in command line
Signed-off-by: Matheus Ferreira <matheus.ferreira@zup.com.br>
1 parent 5748fcc commit b8cb4c0

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/main/kotlin/com/stackspot/intellij/ui/toolwindow/StackSpotCellRenderer.kt

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ import javax.swing.tree.DefaultTreeCellRenderer
3636

3737
private const val COULD_NOT_APPLY_PLUGIN = "Could not apply plugin"
3838
private const val PLUGIN_HAS_DEPENDENCY = "This plugin has dependencies. First, apply these before proceeding:"
39-
4039
class StackSpotCellRenderer(val tree: AbstractStackSpotTree) : DefaultTreeCellRenderer() {
4140

4241
private val panel = object : JPanel() {
@@ -232,12 +231,18 @@ class StackSpotCellRenderer(val tree: AbstractStackSpotTree) : DefaultTreeCellRe
232231
val args = mutableListOf<String>()
233232
varsMap.forEach { (key, value) ->
234233
if (value is Set<*>) {
235-
value.forEach { elem -> args.add("--$key $elem") }
234+
args.add("--$key ${extractSet(value)}")
236235
} else {
237-
args.add("--$key $value")
236+
args.add("--$key \"$value\"")
238237
}
239238
}
240239

241240
return args.toTypedArray()
242241
}
243-
}
242+
243+
private fun extractSet(set: Set<*>) : String {
244+
val str = "$set".replace("[", "").replace("]", "")
245+
return "\"$str\""
246+
}
247+
}
248+

0 commit comments

Comments
 (0)