diff options
| author | Shulhan <ms@kilabit.info> | 2018-10-31 23:03:28 +0700 |
|---|---|---|
| committer | Shulhan <ms@kilabit.info> | 2018-10-31 23:03:28 +0700 |
| commit | 20e98b127e16a40cf9f982cc44cc470ab73a8f9d (patch) | |
| tree | c91a17be2adbadaa2c1c9f78648a09f49f9da373 /package.go | |
| parent | 68d9f5924db1a9e186103bc540c975200dd3c9cf (diff) | |
| download | beku-20e98b127e16a40cf9f982cc44cc470ab73a8f9d.tar.xz | |
env: fix sync "--into" command
Diffstat (limited to 'package.go')
| -rw-r--r-- | package.go | 18 |
1 files changed, 8 insertions, 10 deletions
@@ -50,33 +50,31 @@ type Package struct { // NewPackage create a package set the package version, tag status, and // dependencies. // -func NewPackage(gopathSrc, importPath string) ( - pkg *Package, err error, -) { - repoRoot, err := vcs.RepoRootForImportPath(importPath, debug.Value >= 1) +func NewPackage(gopathSrc, name, importPath string) (pkg *Package, err error) { + repoRoot, err := vcs.RepoRootForImportPath(name, debug.Value >= 1) if err != nil { fmt.Fprintf(defStderr, "[PKG] NewPackage >>> error: %s\n", err.Error()) return } - if debug.Value >= 2 { - fmt.Printf("[PKG] NewPackage >>> %+v\n", *repoRoot) - } - if repoRoot.VCS.Cmd != VCSModeGit { err = fmt.Errorf(errVCS, repoRoot.VCS.Cmd) return nil, err } pkg = &Package{ - ImportPath: repoRoot.Root, - FullPath: filepath.Join(gopathSrc, repoRoot.Root), + ImportPath: importPath, + FullPath: filepath.Join(gopathSrc, importPath), RemoteName: gitDefRemoteName, RemoteURL: repoRoot.Repo, vcsMode: repoRoot.VCS.Cmd, state: packageStateNew, } + if debug.Value >= 2 { + fmt.Printf("[PKG] NewPackage >>> %+v\n", pkg) + } + return } |
