Skip to content

Commit 06648ce

Browse files
authored
Merge pull request ActiveState#3395 from ActiveState/mitchell/dx-2945
Fixed nil pointer error with `state exec` and async runtimes.
2 parents 7474d49 + 3c5287a commit 06648ce

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

internal/runners/exec/exec.go

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,16 @@ func (s *Exec) Run(params *Params, args ...string) (rerr error) {
119119

120120
s.out.Notice(locale.Tr("operating_message", projectNamespace, projectDir))
121121

122-
rt, err := rtrunbit.SolveAndUpdate(s.auth, s.out, s.analytics, proj, nil, trigger, s.svcModel, s.cfg, rtrunbit.OptMinimalUI)
122+
rt, commit, err := rtrunbit.Solve(s.auth, s.out, s.analytics, proj, nil, trigger, s.svcModel, s.cfg, rtrunbit.OptMinimalUI)
123123
if err != nil {
124-
return locale.WrapError(err, "err_activate_runtime", "Could not initialize a runtime for this project.")
124+
return errs.Wrap(err, "Could not initialize runtime")
125+
}
126+
127+
if !s.cfg.GetBool(constants.AsyncRuntimeConfig) {
128+
err = rtrunbit.UpdateByReference(rt, commit, s.auth, proj, s.out, s.cfg, rtrunbit.OptMinimalUI)
129+
if err != nil {
130+
return errs.Wrap(err, "Could not setup runtime")
131+
}
125132
}
126133

127134
venv := virtualenvironment.New(rt)

0 commit comments

Comments
 (0)