Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed panic in case of local module #130

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
15 changes: 7 additions & 8 deletions util/mod.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ func (m *ModDepManager) AddDependency(flogoImport Import) error {
return err
}


err = ExecCmd(exec.Command("go", "mod", "verify"), m.srcDir)
if err == nil {
err = ExecCmd(exec.Command("go", "mod", "download", flogoImport.ModulePath()), m.srcDir)
Expand Down Expand Up @@ -225,7 +224,7 @@ func (m *ModDepManager) GetAllImports() (map[string]Import, error) {
return result, nil
}

//This function converts capotal letters in package name
// This function converts capotal letters in package name
// to !(smallercase). Eg C => !c . As this is the way
// go.mod saves every repository in the $GOPATH/pkg/mod.
func toLower(s []string) []string {
Expand Down Expand Up @@ -304,12 +303,12 @@ func (m *ModDepManager) AddReplacedContribForBuild() error {
//If the length of mods is more than 4 it contains the versions of package
//so it is stating to use different version of pkg rather than
// the local pkg.
if len(mods) < 5 {

m.localMods[mods[1]] = mods[3]
} else {

m.localMods[mods[1]] = filepath.Join(os.Getenv("GOPATH"), "pkg", "mod", mods[3]+"@"+mods[4])
if len(mods) >= 4 {
if len(mods) < 5 {
m.localMods[mods[1]] = mods[3]
} else {
m.localMods[mods[1]] = filepath.Join(os.Getenv("GOPATH"), "pkg", "mod", mods[3]+"@"+mods[4])
}
}

}
Expand Down