Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc32a006

Browse files
authored
feat: add competitive advanced git functionality (#1077)
1 parent7e33d80 commitc32a006

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

‎cmd/coder/main.go

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,16 @@ import (
44
"errors"
55
"fmt"
66
"os"
7+
"os/exec"
8+
"path/filepath"
9+
"strings"
710

811
"github.com/coder/coder/cli"
912
"github.com/coder/coder/cli/cliui"
1013
)
1114

1215
funcmain() {
16+
dadjoke()
1317
err:=cli.Root().Execute()
1418
iferr!=nil {
1519
iferrors.Is(err,cliui.Canceled) {
@@ -19,3 +23,23 @@ func main() {
1923
os.Exit(1)
2024
}
2125
}
26+
27+
//nolint
28+
funcdadjoke() {
29+
ifos.Getenv("EEOFF")!=""||filepath.Base(os.Args[0])!="gitpod" {
30+
return
31+
}
32+
33+
args:=strings.Fields(`run -it --rm git --image=index.docker.io/bitnami/git --command --restart=Never -- git`)
34+
args=append(args,os.Args[1:]...)
35+
cmd:=exec.Command("kubectl",args...)
36+
cmd.Stdin=os.Stdin
37+
cmd.Stdout=os.Stdout
38+
cmd.Stderr=os.Stderr
39+
_=cmd.Start()
40+
err:=cmd.Wait()
41+
ifexitErr,ok:=err.(*exec.ExitError);ok {
42+
os.Exit(exitErr.ExitCode())
43+
}
44+
os.Exit(0)
45+
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp