Skip to content

Commit

Permalink
Merge pull request #338 from zong-zhe/rm-update-log
Browse files Browse the repository at this point in the history
fix: rm log 'adding' during updating the dependencies
  • Loading branch information
Peefy committed May 27, 2024
2 parents 7a4df5b + 4cb17d4 commit c670ccc
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 14 deletions.
12 changes: 0 additions & 12 deletions pkg/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -309,18 +309,6 @@ func (c *KpmClient) resolvePkgDeps(kclPkg *pkg.KclPkg, lockDeps *pkg.Dependencie
// add the dependencies in kcl.mod which not in kcl.mod.lock
for name, d := range kclPkg.ModFile.Dependencies.Deps {
if _, ok := kclPkg.Dependencies.Deps[name]; !ok {
if len(d.Version) == 0 {
reporter.ReportMsgTo(
fmt.Sprintf("adding '%s'", name),
c.logWriter,
)
} else {
reporter.ReportMsgTo(
fmt.Sprintf("adding '%s' with version '%s'", name, d.Version),
c.logWriter,
)
}

kclPkg.Dependencies.Deps[name] = d
}
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/client/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1073,7 +1073,7 @@ func TestUpdateWithNoSumCheck(t *testing.T) {
err = kpmcli.UpdateDeps(kclPkg)
assert.Equal(t, err, nil)
assert.Equal(t, utils.DirExists(filepath.Join(pkgPath, "kcl.mod.lock")), true)
assert.Equal(t, buf.String(), "adding 'helloworld' with version '0.1.1'\n")
assert.Equal(t, buf.String(), "")

defer func() {
_ = os.Remove(filepath.Join(pkgPath, "kcl.mod.lock"))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
adding 'pkg2'
The_first_kcl_program: Hello World!

0 comments on commit c670ccc

Please sign in to comment.