can I execute cmd commands in a pulumi program? I ...
# general
can I execute cmd commands in a pulumi program? I would like to
git clone
a helm chart and run it after
yeah just make sure its awaited or synchronous and it will all be fine just like any other app
what’s the… module / syntax to execute a command?
import child_process i guess
oh, so like a node app? 🤔
there is a Module called cmd in pulumi not sure
if you're using typescript/node you'd use that yeah, python use whatever the equivalent is
oh, so like a node app?
Yes, for JS and TS. Here’s an example from a recent personal project of mine: I am invoking
dotnet publish
, though I am doing it using the synchronous version of
. I am doing that because the async version only accepts a callback and not async/await, which would have required me to create a promise and manually resolve/reject the promise. I didn’t want to do all that, but you could if you wanted to. I also think synchronous exec is fine here.
🔥 1
@clever-sunset-76585 this is exactly what I wanted, thanks for the example!
👍 1