hey again folks :star-struck: possible bug? or may...
# getting-started
m
hey again folks 🤩 possible bug? or maybe just me not understanding the behavior correctly. So I'm using a command.local for some S3 stuff in the pulumi build... with this code:
Copy code
command.local.runOutput({ 
    command: pulumi.interpolate`bash ./compileAndExtract.sh && aws s3 sync ./syncFolder s3://${assetsBucket.bucket} --delete --exact-timestamps && rm -rf syncFolder`,
});
That script basically creates a docker image and uploads some PWA assets to s3. It seems like this is actually fully executed during 'pulumi preview' (ie., the preview command triggers an S3 bucket overwrite) Was this intended by design? I can understand how it's difficult if not impossible to 'preview' an arbitrary command but I'm not sure many folks would expect it to outright just run during preview.
m
This is indeed how local.run is meant to work:
This command will always be run on any preview or deployment. Use local.Command to avoid duplicating executions.
You’re probably looking for the behavior of local.Command.
m
thanks @miniature-musician-31262!
m
You bet! Thanks for sticking with us!