Skip to content

Commit

Permalink
Merge pull request #215 from zong-zhe/add-dep-link
Browse files Browse the repository at this point in the history
feat: create a symbolic link for the dependencies
  • Loading branch information
Peefy authored Nov 17, 2023
2 parents 8d4fdbd + 02199fd commit cb0e284
Showing 1 changed file with 14 additions and 0 deletions.
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

0 comments on commit cb0e284

Please sign in to comment.