MCPcopy Index your code
hub / github.com/jetify-com/devbox / pullCmd

Function pullCmd

internal/boxcli/pull.go:29–50  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

27}
28
29func 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
52func pullCmdFunc(cmd *cobra.Command, url string, flags *pullCmdFlags) error {
53 box, err := devbox.Open(&devopt.Opts{

Callers 1

globalCmdFunction · 0.85

Calls 3

GetDefaultedFunction · 0.92
pullCmdFuncFunction · 0.85
registerMethod · 0.45

Tested by

no test coverage detected