MCPcopy Index your code
hub / github.com/cli/cli / newRebuildCmd

Function newRebuildCmd

pkg/cmd/codespace/rebuild.go:15–41  ·  view source on GitHub ↗
(app *App)

Source from the content-addressed store, hash-verified

13)
14
15func newRebuildCmd(app *App) *cobra.Command {
16 var (
17 selector *CodespaceSelector
18 fullRebuild bool
19 )
20
21 rebuildCmd := &cobra.Command{
22 Use: "rebuild",
23 Short: "Rebuild a codespace",
24 Long: heredoc.Doc(`
25 Rebuilding recreates your codespace.
26
27 Your code and any current changes will be preserved. Your codespace will be rebuilt using
28 your working directory's dev container. A full rebuild also removes cached Docker images.
29 `),
30 Args: cobra.NoArgs,
31 RunE: func(cmd *cobra.Command, args []string) error {
32 return app.Rebuild(cmd.Context(), selector, fullRebuild)
33 },
34 }
35
36 selector = AddCodespaceSelector(rebuildCmd, app.apiClient)
37
38 rebuildCmd.Flags().BoolVar(&fullRebuild, "full", false, "Perform a full rebuild")
39
40 return rebuildCmd
41}
42
43func (a *App) Rebuild(ctx context.Context, selector *CodespaceSelector, full bool) (err error) {
44 ctx, cancel := context.WithCancel(ctx)

Callers 1

NewCmdCodespaceFunction · 0.85

Calls 2

AddCodespaceSelectorFunction · 0.85
RebuildMethod · 0.80

Tested by

no test coverage detected