Skip to content

Commit a3cfc85

Browse files
committed
moved restart fn into workspacebuilds.go
1 parent 7a314a5 commit a3cfc85

File tree

2 files changed

+441
-41
lines changed

2 files changed

+441
-41
lines changed

cli/restart.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,28 +34,33 @@ func (r *RootCmd) restart() *clibase.Cmd {
3434
return err
3535
}
3636

37+
// get the workspace - this can probably stay in here
3738
workspace, err := namedWorkspace(inv.Context(), client, inv.Args[0])
3839
if err != nil {
3940
return err
4041
}
4142

43+
// create a build - stop the workspace
4244
build, err := client.CreateWorkspaceBuild(ctx, workspace.ID, codersdk.CreateWorkspaceBuildRequest{
4345
Transition: codersdk.WorkspaceTransitionStop,
4446
})
4547
if err != nil {
4648
return err
4749
}
50+
// this seems to return the provisioner job - perhaps we are watching for an error
4851
err = cliui.WorkspaceBuild(ctx, out, client, build.ID)
4952
if err != nil {
5053
return err
5154
}
5255

56+
// create a build - start the workspace
5357
build, err = client.CreateWorkspaceBuild(ctx, workspace.ID, codersdk.CreateWorkspaceBuildRequest{
5458
Transition: codersdk.WorkspaceTransitionStart,
5559
})
5660
if err != nil {
5761
return err
5862
}
63+
// this seems to return the provisioner job - perhaps we are watching for an error
5964
err = cliui.WorkspaceBuild(ctx, out, client, build.ID)
6065
if err != nil {
6166
return err

0 commit comments

Comments
 (0)