Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix missing path in metadata #482

Merged
merged 1 commit into from
Sep 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions pkg/package/modfile.go
Original file line number Diff line number Diff line change
Expand Up @@ -267,14 +267,12 @@ func (dep *Dependency) GetLocalFullPath(rootpath string) string {
func (d *Dependency) GenPathSuffix() string {

var storePkgName string

name := d.Name
if d.Source.Oci != nil {
name := filepath.Base(d.Source.Oci.Repo)
storePkgName = fmt.Sprintf(PKG_NAME_PATTERN, name, d.Source.Oci.Tag)
} else if d.Source.Git != nil {
// TODO: new local dependency structure will replace this
// issue: https://github.com/kcl-lang/kpm/issues/384
name := strings.TrimSuffix(filepath.Base(d.Source.Git.Url), filepath.Ext(d.Source.Git.Url))
if d.Source.Git.GetPackage() != "" {
name = strings.Split(d.FullName, "_")[0]
}
Expand All @@ -286,7 +284,6 @@ func (d *Dependency) GenPathSuffix() string {
storePkgName = fmt.Sprintf(PKG_NAME_PATTERN, name, d.Source.Git.Branch)
}
} else if d.Source.Registry != nil {
name := filepath.Base(d.Source.Registry.Oci.Repo)
storePkgName = fmt.Sprintf(PKG_NAME_PATTERN, name, d.Source.Registry.Version)
} else {
storePkgName = fmt.Sprintf(PKG_NAME_PATTERN, d.Name, d.Version)
Expand Down