| Index: vpython/application/subcommand_install.go
|
| diff --git a/vpython/application/subcommand_install.go b/vpython/application/subcommand_install.go
|
| index b9549f84e848090da73f0f26cbc11f5bad79bc6d..8e60d9a8dbeb1df0d6f62223ee6b6f5935fb8f1b 100644
|
| --- a/vpython/application/subcommand_install.go
|
| +++ b/vpython/application/subcommand_install.go
|
| @@ -21,17 +21,29 @@ var subcommandInstall = &subcommands.Command{
|
| LongDesc: "installs the configured VirtualEnv, but doesn't run any associated commands",
|
| Advanced: false,
|
| CommandRun: func() subcommands.CommandRun {
|
| - return &installCommandRun{}
|
| + var cr installCommandRun
|
| +
|
| + fs := cr.GetFlags()
|
| + fs.StringVar(&cr.name, "name", cr.name,
|
| + "Use this VirtualEnv name, instead of generating one via hash. This will force specification "+
|
| + "validation, causing any existing VirtualEnv with this name to be deleted and reprovisioned "+
|
| + "if it doesn't match.")
|
| +
|
| + return &cr
|
| },
|
| }
|
|
|
| type installCommandRun struct {
|
| subcommands.CommandRunBase
|
| +
|
| + name string
|
| }
|
|
|
| func (cr *installCommandRun) Run(app subcommands.Application, args []string, env subcommands.Env) int {
|
| c := cli.GetContext(app, cr, env)
|
| a := getApplication(c, args)
|
| + a.opts.EnvConfig.PruneThreshold = 0 // Don't prune on install.
|
| + a.opts.EnvConfig.OverrideName = cr.name
|
|
|
| return run(c, func(c context.Context) error {
|
| err := venv.With(c, a.opts.EnvConfig, false, func(context.Context, *venv.Env) error {
|
|
|