#Exec without array

1 messages · Page 1 of 1 (latest)

copper hinge
#

Heya, is there a way to exec a command without turning it into an array? I'm getting bash commands from somewhere else and they could be strings like git clone git@github.com:dagger/dagger.git (though with this example I'd ofc know how to split the string into an array)? If I pass it as a whole into Container.withExec I get an error

daring condor
#

👋 easiest way would be to do something like []string{"sh", "-c", "git clone ..."} - if you can trust that there's a shell in the container. This is how Dockerfiles work under the hood