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

feat: create a symbolic link for the dependencies #215

Merged
merged 1 commit into from
Nov 17, 2023
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
14 changes: 14 additions & 0 deletions pkg/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -701,6 +701,13 @@ func (c *KpmClient) Download(dep *pkg.Dependency, localPath string) (*pkg.Depend
}
dep.Version = dep.Source.Git.Tag
dep.LocalFullPath = localPath
// Creating symbolic links in a global cache is not an optimal solution.
// This allows kclvm to locate the package by default.
// This feature is unstable and will be removed soon.
err = utils.CreateSymlink(dep.LocalFullPath, filepath.Join(filepath.Dir(localPath), dep.Name))
if err != nil {
return nil, err
}
dep.FullName = dep.GenDepFullName()
}

Expand All @@ -711,6 +718,13 @@ func (c *KpmClient) Download(dep *pkg.Dependency, localPath string) (*pkg.Depend
}
dep.Version = dep.Source.Oci.Tag
dep.LocalFullPath = localPath
// Creating symbolic links in a global cache is not an optimal solution.
// This allows kclvm to locate the package by default.
// This feature is unstable and will be removed soon.
err = utils.CreateSymlink(dep.LocalFullPath, filepath.Join(filepath.Dir(localPath), dep.Name))
if err != nil {
return nil, err
}
dep.FullName = dep.GenDepFullName()
}

Expand Down