Fix error check in newDeployment
@@ -150,10 +150,10 @@ func newDeployment(ctx *Context, info *deploymentContext, opts deploymentOptions
projinfo := &Projinfo{Proj: proj, Root: info.Update.GetRoot()}
pwd, main, plugctx, err := ProjectInfoContext(projinfo, opts.Host, target,
opts.Diag, opts.StatusDiag, opts.DisableProviderPreview, info.TracingSpan)
- plugctx = plugctx.WithCancelChannel(ctx.Cancel.Canceled())
if err != nil {
return nil, err
}
+ plugctx = plugctx.WithCancelChannel(ctx.Cancel.Canceled())
opts.trustDependencies = proj.TrustResourceDependencies()
// Now create the state source. This may issue an error if it can't create the source. This entails,
