| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 /* |
| 6 Generally only executed once on a given machine, the firstrun command installs |
| 7 the cr tool, prepares a space for it to install modules, and adds it to $PATH. |
| 8 */ |
| 9 |
| 10 package firstrun |
| 11 |
| 12 import ( |
| 13 "flag" |
| 14 |
| 15 "infra/tools/cr/lib/subcommand" |
| 16 ) |
| 17 |
| 18 var ( |
| 19 // Package-level variables for subcommand flags. |
| 20 path string |
| 21 ) |
| 22 |
| 23 var shortHelp = "Install the cr tool and intelligently add it to $PATH." |
| 24 |
| 25 var longHelp = `Given a path to a desired install directory, it takes ownership
of that |
| 26 directory, sets it up to support installation of modules, and adds the |
| 27 directory to $PATH (by prompting to modify e.g. the registry or .bashrc). |
| 28 |
| 29 The firstrun command is intended to only be run once, when first |
| 30 installing the cr tool. |
| 31 |
| 32 Examples: |
| 33 cr firstrun -verbose -path ~/local/bin/` |
| 34 |
| 35 func flags(flags *flag.FlagSet) { |
| 36 flags.StringVar(&path, "path", "", "the path to install 'cr' in") |
| 37 } |
| 38 |
| 39 func run(flags *flag.FlagSet) error { |
| 40 firstrunCheckNotInstalled() |
| 41 return nil |
| 42 } |
| 43 |
| 44 var FirstrunCmd = subcommand.New(shortHelp, longHelp, flags, run) |
| OLD | NEW |