X Tutup
Skip to content

Commit 7673622

Browse files
committed
Mount gh codespace command
1 parent f749590 commit 7673622

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

go.mod

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,4 @@ require (
4545
)
4646

4747
replace github.com/shurcooL/graphql => github.com/cli/shurcooL-graphql v0.0.0-20200707151639-0f7232a2bf7e
48+
replace golang.org/x/crypto => ./internal/crypto

pkg/cmd/root/root.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,12 @@ package root
22

33
import (
44
"net/http"
5+
"os"
56

67
"github.com/MakeNowJust/heredoc"
8+
"github.com/cli/cli/v2/cmd/ghcs"
9+
"github.com/cli/cli/v2/cmd/ghcs/output"
10+
ghcsApi "github.com/cli/cli/v2/internal/api"
711
actionsCmd "github.com/cli/cli/v2/pkg/cmd/actions"
812
aliasCmd "github.com/cli/cli/v2/pkg/cmd/alias"
913
apiCmd "github.com/cli/cli/v2/pkg/cmd/api"
@@ -105,6 +109,15 @@ func NewCmdRoot(f *cmdutil.Factory, version, buildDate string) *cobra.Command {
105109
referenceCmd.SetHelpFunc(referenceHelpFn(f.IOStreams))
106110
cmd.AddCommand(referenceCmd)
107111

112+
ghcsApp := ghcs.NewApp(
113+
output.NewLogger(f.IOStreams.Out, f.IOStreams.ErrOut, !f.IOStreams.IsStdoutTTY()),
114+
ghcsApi.New(os.Getenv("GITHUB_TOKEN"), http.DefaultClient),
115+
)
116+
ghcsCmd := ghcs.NewRootCmd(ghcsApp)
117+
ghcsCmd.Use = "codespace"
118+
ghcsCmd.Aliases = []string{"cs"}
119+
cmd.AddCommand(ghcsCmd)
120+
108121
cmdutil.DisableAuthCheck(cmd)
109122

110123
// this needs to appear last:

0 commit comments

Comments
 (0)
X Tutup