so, after playing with DSL and scripting for a whi...
# opensource
e
so, after playing with DSL and scripting for a while, I'd like to share some of my latest utils/play scenarios, which are basically kotlin dsl wrappers: • kotlin.kts for
kotlin
and
kotlinc
shell command • gradle.kts for
gradle
slurm.kts for Slurm API hopefully they will come in handy to someone else
🎉 1
j
it looks very good, I would like to see more samples, and more complex, tho
e
the way you construct a string command line is a bad idea, is problematic for arguments with spaces or special characters
e
I'm not covering all, this is just the product of what I needed with the available options/docs. However, it won't be hard to fix that, I guess it's just a matter of single/double quotes or?
e
no. build a list
listOf("command", "arg1", "arg2", ...)
and pass it to ProcessBuilder, it is designed to accept a list or varargs
e
ah, ok
does even this have to be split up or I can add it altogether?
Copy code
args += " -howtorun $it"
e
yes, it has to be split up
e
done, thanks for the tip
@Javier I'm gonna use them soon and update the wiki. In the meanwhile, you can give me some snippets which I'd be more than happy to show you how they would become in kts