()
| 27 | } |
| 28 | |
| 29 | func pullCmd() *cobra.Command { |
| 30 | flags := pullCmdFlags{} |
| 31 | cmd := &cobra.Command{ |
| 32 | Use: "pull <file> | <url>", |
| 33 | Short: "Pull a config from a file or URL", |
| 34 | Long: "Pull a config from a file or URL. URLs must be prefixed with 'http://' or 'https://'.", |
| 35 | Args: cobra.MaximumNArgs(1), |
| 36 | PreRunE: ensureNixInstalled, |
| 37 | RunE: func(cmd *cobra.Command, args []string) error { |
| 38 | return pullCmdFunc(cmd, goutil.GetDefaulted(args, 0), &flags) |
| 39 | }, |
| 40 | } |
| 41 | |
| 42 | cmd.Flags().BoolVarP( |
| 43 | &flags.force, "force", "f", false, |
| 44 | "Force overwrite of existing [global] config files", |
| 45 | ) |
| 46 | |
| 47 | flags.config.register(cmd) |
| 48 | |
| 49 | return cmd |
| 50 | } |
| 51 | |
| 52 | func pullCmdFunc(cmd *cobra.Command, url string, flags *pullCmdFlags) error { |
| 53 | box, err := devbox.Open(&devopt.Opts{ |
no test coverage detected