Describe the problem
Whenever I write any bash script, I do this:
#!/bin/bash
set -ex
#Run some command foo
foo --bar --baz
The -x flag logs all bash commands as they're run. It's very useful when debugging things. I was looking for something that does the same in turtle.
Describe your solution
When using turtle in kotlin, I've made this helper function which I use:
fun loggedShellRun(command: String, args: List<String> = emptyList(), workingDir: File? = null): String {
val commandString = "$command ${args.joinToString(" ")}"
println("Exec: $commandString")
val result = shellRun(command, args, workingDir)
return result
}
and then I call it like:
loggedShellRun("foo", listOf("--bar", "--baz"), workingDir)
I think it would be a good idea to include this as a built in feature into the library.
Checklist
Additional context
Describe the problem
Whenever I write any bash script, I do this:
The -x flag logs all bash commands as they're run. It's very useful when debugging things. I was looking for something that does the same in turtle.
Describe your solution
When using turtle in kotlin, I've made this helper function which I use:
and then I call it like:
I think it would be a good idea to include this as a built in feature into the library.
Checklist
Additional context