| Index: go/src/infra/tools/cr/cmd/firstrun.go
|
| diff --git a/go/src/infra/tools/cr/cmd/firstrun.go b/go/src/infra/tools/cr/cmd/firstrun.go
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..85c1f784a98e7de2ad73caead082d03f87277958
|
| --- /dev/null
|
| +++ b/go/src/infra/tools/cr/cmd/firstrun.go
|
| @@ -0,0 +1,36 @@
|
| +// Copyright 2016 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +/*
|
| +Generally only executed once on a given machine, the firstrun command installs
|
| +the cr tool, prepares a space for it to install modules, and adds it to $PATH.
|
| +*/
|
| +
|
| +package cmd
|
| +
|
| +import (
|
| + "fmt"
|
| +
|
| + "github.com/spf13/cobra"
|
| +)
|
| +
|
| +var firstrunCmd = &cobra.Command{
|
| + Use: "firstrun",
|
| + Short: "Install the cr tool and intelligently add it to $PATH",
|
| + Long: `Install the cr too and intelligently add it to $PATH.
|
| +
|
| +Given a path to a desired install directory, it takes ownership of that
|
| +directory, sets it up to support installation of modules, and adds the
|
| +directory to $PATH (by prompting to modify e.g. the registry or .bashrc).
|
| +
|
| +The firstrun command is intended to only be run once, when first
|
| +installing the cr tool.`,
|
| + Run: func(cmd *cobra.Command, args []string) {
|
| + fmt.Println("firstrun called")
|
| + },
|
| +}
|
| +
|
| +func init() {
|
| + RootCmd.AddCommand(firstrunCmd)
|
| +}
|
|
|