Skip to content

Commit f384a5f

Browse files
committed
feat: uniform kcl cli
Signed-off-by: zongz <[email protected]>
1 parent 45415db commit f384a5f

File tree

110 files changed

+261
-83
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

110 files changed

+261
-83
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,7 @@ build/
3434
_kcl_test.k
3535

3636
.DS_store
37+
38+
# e2e test cases dir
39+
scripts/e2e/pkg_in_reg/*
40+
scripts/e2e/registry_auth/*

cmd/kcl/commands/mod.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ var (
3131
vendor bool
3232
update bool
3333
git string
34+
oci string
35+
path string
3436
tag string
3537
commit string
3638
branch string

cmd/kcl/commands/mod_add.go

Lines changed: 98 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ package cmd
22

33
import (
44
"fmt"
5+
"net/url"
56
"os"
67
"path/filepath"
7-
"strings"
88

99
"github.com/spf13/cobra"
1010
"kcl-lang.io/kpm/pkg/client"
@@ -24,11 +24,23 @@ const (
2424
# Add the module dependency named "k8s" with the version "1.28"
2525
kcl mod add k8s:1.28
2626
27-
# Add the module dependency from the GitHub
27+
# Add the module dependency from the GitHub by git url
28+
kcl mod add git://github.com/kcl-lang/konfig --tag v0.4.0
29+
30+
# Add the module dependency from the OCI Registry by oci url
31+
kcl mod add oci://github.com/kcl-lang/konfig --tag v0.4.0
32+
33+
# Add the module dependency from the local file system by file url
34+
kcl mod add /path/to/another_module
35+
36+
# Add the module dependency from the GitHub by flag
2837
kcl mod add --git https://github.com/kcl-lang/konfig --tag v0.4.0
2938
30-
# Add a local dependency
31-
kcl mod add /path/to/another_module`
39+
# Add the module dependency from the OCI Registry by flag
40+
kcl mod add --oci https://ghcr.io/kcl-lang/helloworld --tag 0.1.0
41+
42+
# Add a local dependency by flag
43+
kcl mod add --path /path/to/another_module`
3244
)
3345

3446
// NewModAddCmd returns the mod add command.
@@ -45,7 +57,8 @@ func NewModAddCmd(cli *client.KpmClient) *cobra.Command {
4557
}
4658

4759
cmd.Flags().StringVar(&git, "git", "", "git repository url")
48-
cmd.Flags().StringVar(&tag, "tag", "", "git repository tag")
60+
cmd.Flags().StringVar(&oci, "oci", "", "oci repository url")
61+
cmd.Flags().StringVar(&tag, "tag", "", "git or oci repository tag")
4962
cmd.Flags().StringVar(&commit, "commit", "", "git repository commit")
5063
cmd.Flags().StringVar(&branch, "branch", "", "git repository branch")
5164
cmd.Flags().StringVar(&rename, "rename", "", "rename the dependency")
@@ -122,31 +135,94 @@ func ModAdd(cli *client.KpmClient, args []string) error {
122135

123136
// parseAddOptions will parse the user cli inputs.
124137
func parseAddOptions(cli *client.KpmClient, localPath string, args []string) (*opt.AddOptions, error) {
138+
// parse the CLI command with the following style
139+
// kcl mod add --git https://xxx/xxx --tag 0.0.1
140+
// kcl mod add --oci https://xxx/xxx --tag 0.0.1
141+
// kcl mod add --path /path/to/xxx
125142
if len(args) == 0 {
126-
return &opt.AddOptions{
127-
LocalPath: localPath,
128-
RegistryOpts: opt.RegistryOptions{
129-
Git: &opt.GitOptions{
130-
Url: git,
131-
Tag: tag,
132-
Commit: commit,
133-
Branch: branch,
134-
},
135-
},
136-
NoSumCheck: noSumCheck,
137-
NewPkgName: rename,
138-
}, nil
143+
if len(git) != 0 {
144+
gitUrl, err := url.Parse(git)
145+
if err != nil {
146+
return nil, err
147+
}
148+
gitOpt := opt.NewGitOptionsFromUrl(gitUrl)
149+
if gitOpt == nil {
150+
return nil, fmt.Errorf("invalid git url '%s'", git)
151+
}
152+
153+
gitOpt.Tag = tag
154+
gitOpt.Commit = commit
155+
gitOpt.Branch = branch
156+
157+
return &opt.AddOptions{
158+
LocalPath: localPath,
159+
RegistryOpts: opt.RegistryOptions{Git: gitOpt},
160+
NoSumCheck: noSumCheck,
161+
NewPkgName: rename,
162+
}, nil
163+
} else if len(oci) != 0 {
164+
ociUrl, err := url.Parse(oci)
165+
if err != nil {
166+
return nil, err
167+
}
168+
ociOpt := opt.NewOciOptionsFromUrl(ociUrl)
169+
if ociOpt == nil {
170+
return nil, fmt.Errorf("invalid oci url '%s'", oci)
171+
}
172+
ociOpt.Tag = tag
173+
174+
return &opt.AddOptions{
175+
LocalPath: localPath,
176+
RegistryOpts: opt.RegistryOptions{Oci: ociOpt},
177+
NoSumCheck: noSumCheck,
178+
NewPkgName: rename,
179+
}, nil
180+
} else if len(path) != 0 {
181+
pathUrl, err := url.Parse(path)
182+
if err != nil {
183+
return nil, err
184+
}
185+
186+
pathOpt, err := opt.NewLocalOptionsFromUrl(pathUrl)
187+
if err != (*reporter.KpmEvent)(nil) {
188+
return nil, err
189+
}
190+
191+
return &opt.AddOptions{
192+
LocalPath: localPath,
193+
RegistryOpts: opt.RegistryOptions{Local: pathOpt},
194+
NoSumCheck: noSumCheck,
195+
NewPkgName: rename,
196+
}, nil
197+
}
139198
} else {
199+
// parse the CLI command with the following style
200+
// kcl mod add k8s
201+
// kcl mod add k8s:0.0.1
202+
// kcl mod add /path/to/xxx
203+
// kcl mod add https://xxx/xxx --tag 0.0.1
204+
// kcl mod add oci://xxx/xxx --tag 0.0.1
205+
140206
localPkg, err := parseLocalPathOptions(args)
207+
pkgSource := argsGet(args, 0)
141208
if err != (*reporter.KpmEvent)(nil) {
142-
// parse from 'kpm add xxx:0.0.1'.
143-
ociReg, err := parseOciRegistryOptions(cli, args)
209+
// parse url and ref
210+
regOpt, err := opt.NewRegistryOptionsFrom(pkgSource, cli.GetSettings())
144211
if err != nil {
145212
return nil, err
146213
}
214+
215+
if regOpt.Git != nil {
216+
regOpt.Git.Tag = tag
217+
regOpt.Git.Commit = commit
218+
regOpt.Git.Branch = branch
219+
} else if regOpt.Oci != nil && len(tag) != 0 {
220+
regOpt.Oci.Tag = tag
221+
}
222+
147223
return &opt.AddOptions{
148224
LocalPath: localPath,
149-
RegistryOpts: *ociReg,
225+
RegistryOpts: *regOpt,
150226
NoSumCheck: noSumCheck,
151227
NewPkgName: rename,
152228
}, nil
@@ -159,24 +235,8 @@ func parseAddOptions(cli *client.KpmClient, localPath string, args []string) (*o
159235
}, nil
160236
}
161237
}
162-
}
163238

164-
// parseOciRegistryOptions will parse the oci registry information from user cli inputs.
165-
func parseOciRegistryOptions(cli *client.KpmClient, args []string) (*opt.RegistryOptions, error) {
166-
ociPkgRef := argsGet(args, 0)
167-
name, version, err := parseOciPkgNameAndVersion(ociPkgRef)
168-
if err != nil {
169-
return nil, err
170-
}
171-
172-
return &opt.RegistryOptions{
173-
Oci: &opt.OciOptions{
174-
Reg: cli.GetSettings().DefaultOciRegistry(),
175-
Repo: cli.GetSettings().DefaultOciRepo(),
176-
PkgName: name,
177-
Tag: version,
178-
},
179-
}, nil
239+
return nil, fmt.Errorf("invalid add options")
180240
}
181241

182242
// parseLocalPathOptions will parse the local path information from user cli inputs.
@@ -196,22 +256,3 @@ func parseLocalPathOptions(args []string) (*opt.RegistryOptions, *reporter.KpmEv
196256
}, nil
197257
}
198258
}
199-
200-
// parseOciPkgNameAndVersion will parse package name and version
201-
// from string "<pkg_name>:<pkg_version>".
202-
func parseOciPkgNameAndVersion(s string) (string, string, error) {
203-
parts := strings.Split(s, ":")
204-
if len(parts) == 1 {
205-
return parts[0], "", nil
206-
}
207-
208-
if len(parts) > 2 {
209-
return "", "", reporter.NewErrorEvent(reporter.InvalidPkgRef, fmt.Errorf("invalid oci package reference '%s'", s))
210-
}
211-
212-
if parts[1] == "" {
213-
return "", "", reporter.NewErrorEvent(reporter.InvalidPkgRef, fmt.Errorf("invalid oci package reference '%s'", s))
214-
}
215-
216-
return parts[0], parts[1], nil
217-
}

cmd/kcl/commands/mod_push.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
"github.com/spf13/cobra"
99
"kcl-lang.io/kpm/pkg/client"
1010
"kcl-lang.io/kpm/pkg/errors"
11-
"kcl-lang.io/kpm/pkg/oci"
11+
kpmoci "kcl-lang.io/kpm/pkg/oci"
1212
"kcl-lang.io/kpm/pkg/opt"
1313
pkg "kcl-lang.io/kpm/pkg/package"
1414
"kcl-lang.io/kpm/pkg/reporter"
@@ -72,7 +72,7 @@ func genDefaultOciUrlForKclPkg(pkg *pkg.KclPkg, cli *client.KpmClient) (string,
7272
urlPath := utils.JoinPath(cli.GetSettings().DefaultOciRepo(), pkg.GetPkgName())
7373

7474
u := &url.URL{
75-
Scheme: oci.OCI_SCHEME,
75+
Scheme: kpmoci.OCI_SCHEME,
7676
Host: cli.GetSettings().DefaultOciRegistry(),
7777
Path: urlPath,
7878
}
@@ -169,7 +169,7 @@ func pushPackage(ociUrl string, kclPkg *pkg.KclPkg, vendorMode bool, cli *client
169169
"only support url scheme 'oci://'.",
170170
)
171171
}
172-
ociOpts.Annotations, err = oci.GenOciManifestFromPkg(kclPkg)
172+
ociOpts.Annotations, err = kpmoci.GenOciManifestFromPkg(kclPkg)
173173
if err != nil {
174174
return err
175175
}

go.mod

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ require (
1010
kcl-lang.io/kcl-go v0.9.0-beta.1
1111
kcl-lang.io/kcl-openapi v0.6.1
1212
kcl-lang.io/kcl-playground v0.5.1
13-
kcl-lang.io/kpm v0.9.0-beta.1
13+
kcl-lang.io/kpm v0.9.0-beta.1.0.20240605035613-c5c5085800b4
1414
)
1515

1616
require (
@@ -29,6 +29,7 @@ require (
2929
github.com/containers/libtrust v0.0.0-20230121012942-c1716e8a8d01 // indirect
3030
github.com/containers/ocicrypt v1.1.10 // indirect
3131
github.com/containers/storage v1.54.0 // indirect
32+
github.com/cpuguy83/go-md2man/v2 v2.0.3 // indirect
3233
github.com/distribution/reference v0.6.0 // indirect
3334
github.com/emicklei/proto v1.13.2 // indirect
3435
github.com/felixge/httpsnoop v1.0.4 // indirect
@@ -52,9 +53,12 @@ require (
5253
github.com/moby/sys/user v0.1.0 // indirect
5354
github.com/opencontainers/runtime-spec v1.2.0 // indirect
5455
github.com/pelletier/go-toml/v2 v2.0.8 // indirect
56+
github.com/russross/blackfriday/v2 v2.1.0 // indirect
5557
github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635 // indirect
5658
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
5759
github.com/ulikunitz/xz v0.5.12 // indirect
60+
github.com/urfave/cli/v2 v2.25.0 // indirect
61+
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect
5862
go.opencensus.io v0.24.0 // indirect
5963
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0 // indirect
6064
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 // indirect

go.sum

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,7 @@ github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSV
331331
github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA=
332332
github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
333333
github.com/cpuguy83/go-md2man/v2 v2.0.1/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
334+
github.com/cpuguy83/go-md2man/v2 v2.0.3 h1:qMCsGGgs+MAzDFyp9LpAe1Lqy/fY/qCovCm0qnXZOBM=
334335
github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
335336
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
336337
github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
@@ -867,7 +868,9 @@ github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFR
867868
github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs=
868869
github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8=
869870
github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4=
871+
github.com/russross/blackfriday v1.6.0 h1:KqfZb0pUVN2lYqZUYRddxF4OR8ZMURnJIG5Y3VRLtww=
870872
github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
873+
github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk=
871874
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
872875
github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts=
873876
github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc=
@@ -934,13 +937,18 @@ github.com/ugorji/go/codec v1.2.11/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZ
934937
github.com/ulikunitz/xz v0.5.10/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14=
935938
github.com/ulikunitz/xz v0.5.12 h1:37Nm15o69RwBkXM0J6A5OlE67RZTfzUxTj8fB3dfcsc=
936939
github.com/ulikunitz/xz v0.5.12/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14=
940+
github.com/urfave/cli v1.22.14 h1:ebbhrRiGK2i4naQJr+1Xj92HXZCrK7MsyTS/ob3HnAk=
941+
github.com/urfave/cli/v2 v2.25.0 h1:ykdZKuQey2zq0yin/l7JOm9Mh+pg72ngYMeB0ABn6q8=
942+
github.com/urfave/cli/v2 v2.25.0/go.mod h1:GHupkWPMM0M/sj1a2b4wUrWBPzazNrIjouW6fmdJLxc=
937943
github.com/vbatts/tar-split v0.11.5 h1:3bHCTIheBm1qFTcgh9oPu+nNBtX+XJIupG/vacinCts=
938944
github.com/vbatts/tar-split v0.11.5/go.mod h1:yZbwRsSeGjusneWgA781EKej9HF8vme8okylkAeNKLk=
939945
github.com/wk8/go-ordered-map/v2 v2.1.8 h1:5h/BUHu93oj4gIdvHHHGsScSTMijfx5PeYkE/fJgbpc=
940946
github.com/wk8/go-ordered-map/v2 v2.1.8/go.mod h1:5nJHM5DyteebpVlHnWMV0rPz6Zp7+xBAnxjb1X5vnTw=
941947
github.com/xanzy/ssh-agent v0.3.3 h1:+/15pJfg/RsTxqYcX6fHqOXZwwMP+2VyYWJeWM2qQFM=
942948
github.com/xanzy/ssh-agent v0.3.3/go.mod h1:6dzNDKs0J9rVPHPhaGCukekBHKqfl+L3KghI1Bc68Uw=
943949
github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU=
950+
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU=
951+
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673/go.mod h1:N3UwUGtsrSj3ccvlPHLoLsHnpR27oXr4ZE984MbSER8=
944952
github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
945953
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
946954
github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
@@ -1685,6 +1693,14 @@ kcl-lang.io/kcl-playground v0.5.1 h1:MKQQUHgt4+2QyU2NVwa73oksOaBJGDi4keGoggA0MiU
16851693
kcl-lang.io/kcl-playground v0.5.1/go.mod h1:IFmnlw7m011ccX8OidMUfnnN2u/TWdtQGxyABRTbmow=
16861694
kcl-lang.io/kpm v0.9.0-beta.1 h1:buc7yp6RR3MJPG0Un6IkkCpQaVPF8LnwgZtluY0a6dA=
16871695
kcl-lang.io/kpm v0.9.0-beta.1/go.mod h1:QJNbc1+go6OXAhiiBHJ7GAjYJ1AC5wLmKAmDS9o5n+k=
1696+
kcl-lang.io/kpm v0.9.0-beta.1.0.20240530104317-7a35562e78a2 h1:c/xCUaE/5rnN4FQjgh+Hd0QGl2KmeWxuibgtsjr+y40=
1697+
kcl-lang.io/kpm v0.9.0-beta.1.0.20240530104317-7a35562e78a2/go.mod h1:QJNbc1+go6OXAhiiBHJ7GAjYJ1AC5wLmKAmDS9o5n+k=
1698+
kcl-lang.io/kpm v0.9.0-beta.1.0.20240604083117-d7258bd4bbf0 h1:t5Z8qa9DzZVG8yLR95rYTOeWhFjUZi+aa06Oxw27jk0=
1699+
kcl-lang.io/kpm v0.9.0-beta.1.0.20240604083117-d7258bd4bbf0/go.mod h1:QJNbc1+go6OXAhiiBHJ7GAjYJ1AC5wLmKAmDS9o5n+k=
1700+
kcl-lang.io/kpm v0.9.0-beta.1.0.20240604093242-4244558de99a h1:2Y/Ek+TgDFMzq2dlbiRNAc2LXgeOByzWRPSzTSasFjE=
1701+
kcl-lang.io/kpm v0.9.0-beta.1.0.20240604093242-4244558de99a/go.mod h1:QJNbc1+go6OXAhiiBHJ7GAjYJ1AC5wLmKAmDS9o5n+k=
1702+
kcl-lang.io/kpm v0.9.0-beta.1.0.20240605035613-c5c5085800b4 h1:G4hkxgAQcxYt5vOIfma944KFLcMi6da7b8SnDRw9Cmg=
1703+
kcl-lang.io/kpm v0.9.0-beta.1.0.20240605035613-c5c5085800b4/go.mod h1:QJNbc1+go6OXAhiiBHJ7GAjYJ1AC5wLmKAmDS9o5n+k=
16881704
kcl-lang.io/lib v0.9.0-beta.1 h1:oO/3h5Ubk61LKVnE7A9xlV4FfSfKa6Jv+KNsoHMcnNc=
16891705
kcl-lang.io/lib v0.9.0-beta.1/go.mod h1:ubsalGXxJaa5II/EsHmsI/tL2EluYHIcW+BwzQPt+uY=
16901706
oras.land/oras-go v1.2.5 h1:XpYuAwAb0DfQsunIyMfeET92emK8km3W4yEzZvUbsTo=

scripts/e2e/push_pkg.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ $current_dir/bin/kcl mod push
1717
cd "$current_dir"
1818

1919
# Push the package helloworld/0.1.1 to the registry
20-
cd ./scripts/pkg_in_reg/ghcr.io/kcl-lang/helloworld/0.1.1
20+
cd ./scripts/e2e/pkg_in_reg/ghcr.io/kcl-lang/helloworld/0.1.1
2121
$current_dir/bin/kcl mod push
2222

2323
cd "$current_dir"

scripts/e2e/registry_auth/htpasswd

Lines changed: 0 additions & 2 deletions
This file was deleted.
Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1 @@
1-
adding dependency 'konfig'
2-
cloning 'https://github.com/kcl-lang/konfig' with tag 'v0.4.0'
3-
downloading 'test/k8s:1.28' from 'localhost:5001/test/k8s:1.28'
4-
add dependency 'konfig:v0.4.0' successfully
1+
add dependency 'konfig:v0.4.0' successfully
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
kcl mod add --git https://github.com/kcl-lang/konfig --branch main

test/e2e/test_suites/test_kcl_mod_add_git_1/stderr

Whitespace-only changes.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
add dependency 'konfig:main' successfully
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[package]
2+
name = "test_space"
3+
edition = "v0.9.0"
4+
version = "0.0.1"
5+

test/e2e/test_suites/test_kcl_mod_add_git_1/test_space/kcl.mod.lock

Whitespace-only changes.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
The_first_kcl_program = 'Hello World!'
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
kcl mod add --git https://github.com/kcl-lang/konfig --commit 01ca24c

test/e2e/test_suites/test_kcl_mod_add_git_2/stderr

Whitespace-only changes.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
add dependency 'konfig:01ca24c' successfully
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[package]
2+
name = "test_space"
3+
edition = "v0.9.0"
4+
version = "0.0.1"
5+

test/e2e/test_suites/test_kcl_mod_add_git_2/test_space/kcl.mod.lock

Whitespace-only changes.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
The_first_kcl_program = 'Hello World!'
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
kcl mod add --git ssh://github.com/kcl-lang/konfig --commit 01ca24c

test/e2e/test_suites/test_kcl_mod_add_git_3/stderr

Whitespace-only changes.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
add dependency 'konfig:01ca24c' successfully
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[package]
2+
name = "test_space"
3+
edition = "v0.9.0"
4+
version = "0.0.1"
5+

test/e2e/test_suites/test_kcl_mod_add_git_3/test_space/kcl.mod.lock

Whitespace-only changes.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
The_first_kcl_program = 'Hello World!'

0 commit comments

Comments
 (0)