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

Function pushCmdFunc

internal/boxcli/push.go:38–62  ·  view source on GitHub ↗
(cmd *cobra.Command, url string, flags pushCmdFlags)

Source from the content-addressed store, hash-verified

36}
37
38func pushCmdFunc(cmd *cobra.Command, url string, flags pushCmdFlags) error {
39 box, err := devbox.Open(&devopt.Opts{
40 Dir: flags.config.path,
41 Environment: flags.config.environment,
42 Stderr: cmd.ErrOrStderr(),
43 })
44 if err != nil {
45 return errors.WithStack(err)
46 }
47 t, err := identity.GenSession(cmd.Context())
48 var creds devopt.Credentials
49 if err != nil && !errors.Is(err, auth.ErrNotLoggedIn) {
50 return errors.WithStack(err)
51 } else if t != nil && err == nil {
52 creds = devopt.Credentials{
53 IDToken: t.IDToken,
54 Email: t.IDClaims().Email,
55 Sub: t.IDClaims().Subject,
56 }
57 }
58 return box.Push(cmd.Context(), devopt.PullboxOpts{
59 URL: url,
60 Credentials: creds,
61 })
62}

Callers 1

pushCmdFunction · 0.85

Calls 4

OpenFunction · 0.92
GenSessionFunction · 0.92
IsMethod · 0.80
PushMethod · 0.45

Tested by

no test coverage detected