Skip to content

Commit a098f83

Browse files
committed
Extract pkg/ into go-utils repository
1 parent a3a49cc commit a098f83

File tree

25 files changed

+33
-1108
lines changed

25 files changed

+33
-1108
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ executes the downloaded binary at the root of the project directory with the res
148148
Additionally, the _CONFIG_FILE_ environment variable is set with the path to a temporary file containing command specific configuration in JSON format.
149149

150150
Modules can be implemented in any language. However, it is recommended to write them in Go
151-
using the `github.com/code-game-project/codegame-cli/pkg/*` packages and the `github.com/Bananenpro/cli` package for CLI interaction in order to be consistent with the CLI and other modules.
151+
using the `github.com/code-game-project/go-utils` and `github.com/Bananenpro/cli` packages in order to avoid bugs and be consistent with the CLI and other modules.
152152

153153
### new
154154

cmd/build.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ import (
44
"fmt"
55
"os"
66

7-
"github.com/code-game-project/codegame-cli/pkg/cgfile"
8-
"github.com/code-game-project/codegame-cli/pkg/external"
9-
"github.com/code-game-project/codegame-cli/pkg/modules"
7+
"github.com/code-game-project/go-utils/cgfile"
8+
"github.com/code-game-project/go-utils/external"
9+
"github.com/code-game-project/go-utils/modules"
1010
"github.com/spf13/cobra"
1111
)
1212

cmd/changeUrl.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ import (
55
"strings"
66

77
"github.com/Bananenpro/cli"
8-
"github.com/code-game-project/codegame-cli/pkg/cgfile"
9-
"github.com/code-game-project/codegame-cli/pkg/external"
10-
"github.com/code-game-project/codegame-cli/pkg/server"
8+
"github.com/code-game-project/go-utils/cgfile"
9+
"github.com/code-game-project/go-utils/external"
10+
"github.com/code-game-project/go-utils/server"
1111
"github.com/spf13/cobra"
1212
)
1313

cmd/docs.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ import (
77
_ "embed"
88

99
"github.com/Bananenpro/cli"
10-
"github.com/code-game-project/codegame-cli/pkg/cggenevents"
11-
"github.com/code-game-project/codegame-cli/pkg/exec"
12-
"github.com/code-game-project/codegame-cli/pkg/server"
10+
"github.com/code-game-project/go-utils/cggenevents"
11+
"github.com/code-game-project/go-utils/exec"
12+
"github.com/code-game-project/go-utils/server"
1313
"github.com/gomarkdown/markdown"
1414
"github.com/gomarkdown/markdown/html"
1515
"github.com/gomarkdown/markdown/parser"

cmd/info.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ import (
88
"unicode/utf8"
99

1010
"github.com/Bananenpro/cli"
11-
"github.com/code-game-project/codegame-cli/pkg/external"
12-
"github.com/code-game-project/codegame-cli/pkg/server"
11+
"github.com/code-game-project/go-utils/external"
12+
"github.com/code-game-project/go-utils/server"
1313
"github.com/mattn/go-colorable"
1414
"github.com/spf13/cobra"
1515
)

cmd/new.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ import (
1313
_ "embed"
1414

1515
"github.com/Bananenpro/cli"
16-
"github.com/code-game-project/codegame-cli/pkg/cgfile"
17-
"github.com/code-game-project/codegame-cli/pkg/cggenevents"
18-
"github.com/code-game-project/codegame-cli/pkg/exec"
19-
"github.com/code-game-project/codegame-cli/pkg/external"
20-
"github.com/code-game-project/codegame-cli/pkg/modules"
21-
"github.com/code-game-project/codegame-cli/pkg/server"
16+
"github.com/code-game-project/go-utils/cgfile"
17+
"github.com/code-game-project/go-utils/cggenevents"
18+
"github.com/code-game-project/go-utils/exec"
19+
"github.com/code-game-project/go-utils/external"
20+
"github.com/code-game-project/go-utils/modules"
21+
"github.com/code-game-project/go-utils/server"
2222
"github.com/spf13/cobra"
2323
)
2424

cmd/run.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ import (
44
"fmt"
55
"os"
66

7-
"github.com/code-game-project/codegame-cli/pkg/cgfile"
8-
"github.com/code-game-project/codegame-cli/pkg/external"
9-
"github.com/code-game-project/codegame-cli/pkg/modules"
7+
"github.com/code-game-project/go-utils/cgfile"
8+
"github.com/code-game-project/go-utils/external"
9+
"github.com/code-game-project/go-utils/modules"
1010
"github.com/spf13/cobra"
1111
)
1212

cmd/update.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ import (
55
"os"
66
"strings"
77

8-
"github.com/code-game-project/codegame-cli/pkg/cgfile"
9-
"github.com/code-game-project/codegame-cli/pkg/cggenevents"
10-
"github.com/code-game-project/codegame-cli/pkg/external"
11-
"github.com/code-game-project/codegame-cli/pkg/modules"
12-
"github.com/code-game-project/codegame-cli/pkg/server"
8+
"github.com/code-game-project/go-utils/cgfile"
9+
"github.com/code-game-project/go-utils/cggenevents"
10+
"github.com/code-game-project/go-utils/external"
11+
"github.com/code-game-project/go-utils/modules"
12+
"github.com/code-game-project/go-utils/server"
1313
"github.com/spf13/cobra"
1414
)
1515

go.mod

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,16 @@ module github.com/code-game-project/codegame-cli
33
go 1.18
44

55
require (
6-
github.com/Bananenpro/cli v0.1.5
7-
github.com/adrg/xdg v0.4.0
6+
github.com/Bananenpro/cli v0.2.1
7+
github.com/code-game-project/go-utils v0.1.0
88
github.com/gomarkdown/markdown v0.0.0-20220627144906-e9a81102ebeb
99
github.com/mattn/go-colorable v0.1.12
1010
github.com/spf13/cobra v1.5.0
1111
)
1212

1313
require (
1414
github.com/AlecAivazis/survey/v2 v2.3.5 // indirect
15+
github.com/adrg/xdg v0.4.0 // indirect
1516
github.com/inconshreveable/mousetrap v1.0.0 // indirect
1617
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect
1718
github.com/mattn/go-isatty v0.0.14 // indirect

go.sum

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,19 @@
11
github.com/AlecAivazis/survey/v2 v2.3.5 h1:A8cYupsAZkjaUmhtTYv3sSqc7LO5mp1XDfqe5E/9wRQ=
22
github.com/AlecAivazis/survey/v2 v2.3.5/go.mod h1:4AuI9b7RjAR+G7v9+C4YSlX/YL3K3cWNXgWXOhllqvI=
3-
github.com/Bananenpro/cli v0.1.3 h1:FmMsU7Vc0h9b311Ki8LhGkcS6fPINUE+ci5jZNVs178=
4-
github.com/Bananenpro/cli v0.1.3/go.mod h1:JBXpIAXo/D0rlsfgCViQBicjcJY6UWUldmxvKM+ijRc=
5-
github.com/Bananenpro/cli v0.1.5 h1:6JbIE1BnhzooklfgqjWbAkNhf+AyOpAbSzSNFJAdr9s=
6-
github.com/Bananenpro/cli v0.1.5/go.mod h1:JBXpIAXo/D0rlsfgCViQBicjcJY6UWUldmxvKM+ijRc=
3+
github.com/Bananenpro/cli v0.2.1 h1:gzW9QCGFo5QbevVdcVbNFBTbQaM4piLd57TPWBehPCU=
4+
github.com/Bananenpro/cli v0.2.1/go.mod h1:JBXpIAXo/D0rlsfgCViQBicjcJY6UWUldmxvKM+ijRc=
75
github.com/Netflix/go-expect v0.0.0-20220104043353-73e0943537d2 h1:+vx7roKuyA63nhn5WAunQHLTznkw5W8b1Xc0dNjp83s=
86
github.com/Netflix/go-expect v0.0.0-20220104043353-73e0943537d2/go.mod h1:HBCaDeC1lPdgDeDbhX8XFpy1jqjK0IBG8W5K+xYqA0w=
97
github.com/adrg/xdg v0.4.0 h1:RzRqFcjH4nE5C6oTAxhBtoE2IRyjBSa62SCbyPidvls=
108
github.com/adrg/xdg v0.4.0/go.mod h1:N6ag73EX4wyxeaoeHctc1mas01KZgsj5tYiAIwqJE/E=
9+
github.com/code-game-project/go-utils v0.1.0 h1:mtxld853WsjVeDFP4l5hMGaq7thXDLslkxC3MEdyPMY=
10+
github.com/code-game-project/go-utils v0.1.0/go.mod h1:kQ6kH9XDzdM2pnJUI1lw61Gp8XOams/E2dKABa1mBI8=
1111
github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
1212
github.com/creack/pty v1.1.17 h1:QeVUsEDNrLBW4tMgZHvxy18sKtr6VI492kBhUfhDJNI=
1313
github.com/creack/pty v1.1.17/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4=
1414
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
1515
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
1616
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
17-
github.com/gomarkdown/markdown v0.0.0-20220607163217-45f7c050e2d1 h1:wAupuFkZ/yq219/mSbqDtMfUZQY0gTYEtoz3/LKtppU=
18-
github.com/gomarkdown/markdown v0.0.0-20220607163217-45f7c050e2d1/go.mod h1:JDGcbDT52eL4fju3sZ4TeHGsQwhG9nbDV21aMyhwPoA=
1917
github.com/gomarkdown/markdown v0.0.0-20220627144906-e9a81102ebeb h1:5b/eFaSaKPFG9ygDBaPKkydKU5nFJYk08g9jPIVogMg=
2018
github.com/gomarkdown/markdown v0.0.0-20220627144906-e9a81102ebeb/go.mod h1:JDGcbDT52eL4fju3sZ4TeHGsQwhG9nbDV21aMyhwPoA=
2119
github.com/hinshun/vt10x v0.0.0-20220119200601-820417d04eec h1:qv2VnGeEQHchGaZ/u7lxST/RaJw+cv273q79D81Xbog=
@@ -50,15 +48,9 @@ golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBc
5048
golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
5149
golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
5250
golang.org/x/sys v0.0.0-20220422013727-9388b58f7150/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
53-
golang.org/x/sys v0.0.0-20220615213510-4f61da869c0c h1:aFV+BgZ4svzjfabn8ERpuB4JI4N6/rdy1iusx77G3oU=
54-
golang.org/x/sys v0.0.0-20220615213510-4f61da869c0c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
55-
golang.org/x/sys v0.0.0-20220727055044-e65921a090b8 h1:dyU22nBWzrmTQxtNrr4dzVOvaw35nUYE279vF9UmsI8=
56-
golang.org/x/sys v0.0.0-20220727055044-e65921a090b8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
5751
golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10 h1:WIoqL4EROvwiPdUtaip4VcDdpZ4kha7wBWZrbVKCIZg=
5852
golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
5953
golang.org/x/term v0.0.0-20210503060354-a79de5458b56/go.mod h1:tfny5GFUkzUvx4ps4ajbZsCe5lw1metzhBm9T3x7oIY=
60-
golang.org/x/term v0.0.0-20220526004731-065cf7ba2467 h1:CBpWXWQpIRjzmkkA+M7q9Fqnwd2mZr3AFqexg8YTfoM=
61-
golang.org/x/term v0.0.0-20220526004731-065cf7ba2467/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
6254
golang.org/x/term v0.0.0-20220722155259-a9ba230a4035 h1:Q5284mrmYTpACcm+eAKjKJH48BBwSyfJqmmGDTtT8Vc=
6355
golang.org/x/term v0.0.0-20220722155259-a9ba230a4035/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
6456
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=

0 commit comments

Comments
 (0)