diff --git a/mod/require.go b/mod/require.go index 50f13aba..157a7f1a 100644 --- a/mod/require.go +++ b/mod/require.go @@ -4,6 +4,7 @@ import ( "fmt" "os" "path" + "path/filepath" "regexp" "strings" ) @@ -85,6 +86,11 @@ func replace(r *Require, sourceRepoPath, destPath string) error { return err } + // Make sure the destination exists + if err := os.MkdirAll(filepath.Dir(destPath), 0755); err != nil { + return err + } + if err := os.Rename(path.Join(sourceRepoPath, r.clonePath), destPath); err != nil { return err }