OLD | NEW |
1 // Copyright 2017 The LUCI Authors. All rights reserved. | 1 // Copyright 2017 The LUCI Authors. All rights reserved. |
2 // Use of this source code is governed under the Apache License, Version 2.0 | 2 // Use of this source code is governed under the Apache License, Version 2.0 |
3 // that can be found in the LICENSE file. | 3 // that can be found in the LICENSE file. |
4 | 4 |
5 package application | 5 package application |
6 | 6 |
7 import ( | 7 import ( |
8 "github.com/maruel/subcommands" | 8 "github.com/maruel/subcommands" |
9 "golang.org/x/net/context" | 9 "golang.org/x/net/context" |
10 | 10 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 c := cli.GetContext(app, cr, env) | 43 c := cli.GetContext(app, cr, env) |
44 a := getApplication(c, args) | 44 a := getApplication(c, args) |
45 a.opts.EnvConfig.PruneThreshold = 0 // Don't prune on install. | 45 a.opts.EnvConfig.PruneThreshold = 0 // Don't prune on install. |
46 a.opts.EnvConfig.OverrideName = cr.name | 46 a.opts.EnvConfig.OverrideName = cr.name |
47 | 47 |
48 return run(c, func(c context.Context) error { | 48 return run(c, func(c context.Context) error { |
49 err := venv.With(c, a.opts.EnvConfig, false, func(context.Contex
t, *venv.Env) error { | 49 err := venv.With(c, a.opts.EnvConfig, false, func(context.Contex
t, *venv.Env) error { |
50 return nil | 50 return nil |
51 }) | 51 }) |
52 if err != nil { | 52 if err != nil { |
53 » » » return errors.Annotate(err).Reason("failed to setup the
environment").Err() | 53 » » » return errors.Annotate(err, "failed to setup the environ
ment").Err() |
54 } | 54 } |
55 | 55 |
56 logging.Infof(c, "Successfully setup the environment.") | 56 logging.Infof(c, "Successfully setup the environment.") |
57 return nil | 57 return nil |
58 }) | 58 }) |
59 } | 59 } |
OLD | NEW |