Skip to content
This repository has been archived by the owner on Feb 26, 2019. It is now read-only.

Resolve the symbolic link of repo root directory. #488

Closed
wants to merge 1 commit into from
Closed
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
18 changes: 16 additions & 2 deletions save.go
Original file line number Diff line number Diff line change
Expand Up @@ -377,11 +377,25 @@ func copySrc(dir string, deps []Dependency) error {
log.Println(err)
ok = false
}
// resolve the symbolic link of repo dir
real_dep := dep.dir
real_depi, err := os.Lstat(real_dep)
for (err == nil) && (real_depi.Mode()&os.ModeSymlink != 0) {
real_dep, err = os.Readlink(real_dep)
if err == nil {
real_depi, err = os.Lstat(real_dep)
}
}
if err != nil {
log.Println(err)
ok = false
}
debugln("real_dep", real_dep)

// copy actual dependency
vf := dep.vcs.listFiles(dep.dir)
vf := dep.vcs.listFiles(real_dep)
debugln("vf", vf)
w := fs.Walk(dep.dir)
w := fs.Walk(real_dep)
for w.Step() {
err = copyPkgFile(vf, dir, srcdir, w)
if err != nil {
Expand Down