Merge pull request #1101 from xushiwei/q
xtool/cppkg: InstallPkg allows to customize cacheDir
This commit is contained in:
@@ -29,13 +29,13 @@ const (
|
||||
// pkgAndVer: 7bitcoder/7bitconf@1.2.0
|
||||
func Install(pkgAndVer string, flags int) {
|
||||
pkgPath, ver := parsePkgVer(pkgAndVer)
|
||||
_, _, err := InstallPkg(pkgPath, ver, nil, flags)
|
||||
_, _, err := InstallPkg("", pkgPath, ver, nil, flags)
|
||||
check(err)
|
||||
}
|
||||
|
||||
// InstallPkg installs a package with the given package path and version.
|
||||
func InstallPkg(pkgPath, ver string, options []string, flags int) (pkg *Package, buildDir string, err error) {
|
||||
m, err := New("")
|
||||
func InstallPkg(cacheDir, pkgPath, ver string, options []string, flags int) (pkg *Package, buildDir string, err error) {
|
||||
m, err := New(cacheDir)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user