aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2018-09-14 21:48:53 +0700
committerShulhan <ms@kilabit.info>2018-09-14 21:48:53 +0700
commit87fb5fe3aa0ca3be30d8617cc57c6202eec301ca (patch)
tree48e71ecb13047b8b238e92486b0758eaa0100da4
parent8073fb8b229c1291954b968f05e3eb91111ec782 (diff)
downloadbeku-87fb5fe3aa0ca3be30d8617cc57c6202eec301ca.tar.xz
package: remove unneeded scan path
-rw-r--r--env_test.go1
-rw-r--r--package.go11
-rw-r--r--package_test.go2
3 files changed, 2 insertions, 12 deletions
diff --git a/env_test.go b/env_test.go
index 6cb933a..d245753 100644
--- a/env_test.go
+++ b/env_test.go
@@ -497,7 +497,6 @@ func testEnvScan(t *testing.T) {
expPkgs: []*Package{{
ImportPath: testGitRepo,
FullPath: filepath.Join(testEnv.dirSrc, testGitRepo),
- ScanPath: filepath.Join(testEnv.dirSrc, testGitRepo),
RemoteName: "origin",
RemoteURL: testGitRepoSrcLocal,
RemoteBranch: "master",
diff --git a/package.go b/package.go
index 8ea673a..dcf290b 100644
--- a/package.go
+++ b/package.go
@@ -32,7 +32,6 @@ const (
type Package struct {
ImportPath string
FullPath string
- ScanPath string
RemoteName string
RemoteURL string
RemoteBranch string
@@ -71,8 +70,7 @@ func NewPackage(env *Env, pkgName, importPath string) (
pkg = &Package{
ImportPath: repoRoot.Root,
- FullPath: filepath.Join(env.dirSrc, repoRoot.Root),
- ScanPath: filepath.Join(env.dirSrc, importPath),
+ FullPath: filepath.Join(env.dirSrc, importPath),
RemoteName: gitDefRemoteName,
RemoteURL: repoRoot.Repo,
vcsMode: repoRoot.VCS.Cmd,
@@ -341,10 +339,6 @@ func (pkg *Package) GetRecursiveImports(env *Env) (
cmd.Dir = pkg.FullPath
cmd.Stderr = defStderr
- if len(pkg.ScanPath) > 0 {
- cmd.Dir = pkg.ScanPath
- }
-
if debug.Value >= 1 {
fmt.Printf("= GetRecursiveImports %s %s\n", cmd.Dir, cmd.Args)
}
@@ -533,7 +527,6 @@ func (pkg *Package) String() string {
fmt.Fprintf(&buf, `
[package "%s"]
FullPath = %s
- ScanPath = %s
VCS = %s
RemoteName = %s
RemoteURL = %s
@@ -544,7 +537,7 @@ func (pkg *Package) String() string {
Deps = %v
RequiredBy = %v
DepsMissing = %v
-`, pkg.ImportPath, pkg.FullPath, pkg.ScanPath, pkg.vcsMode, pkg.RemoteName,
+`, pkg.ImportPath, pkg.FullPath, pkg.vcsMode, pkg.RemoteName,
pkg.RemoteURL, pkg.RemoteBranch, pkg.Version, pkg.VersionNext,
pkg.isTag, pkg.Deps, pkg.RequiredBy, pkg.DepsMissing)
diff --git a/package_test.go b/package_test.go
index 0d73dfc..c118114 100644
--- a/package_test.go
+++ b/package_test.go
@@ -70,7 +70,6 @@ func testPackageInstall(t *testing.T) {
pkg: testGitPkgInstall,
expPkg: &Package{
ImportPath: testGitRepo,
- ScanPath: testGitPkgInstall.FullPath,
FullPath: testGitPkgInstall.FullPath,
RemoteName: gitDefRemoteName,
RemoteURL: testGitPkgInstall.RemoteURL,
@@ -518,7 +517,6 @@ func testPackageString(t *testing.T) {
exp: `
[package "github.com/shuLhan/beku_test"]
FullPath = ` + filepath.Join(testEnv.dirSrc, testGitRepo) + `
- ScanPath = ` + filepath.Join(testEnv.dirSrc, testGitRepo) + `
VCS = git
RemoteName = origin
RemoteURL = ` + testGitRepoSrcLocal + `