Merge pull request #1098 from samalba/fix-mod-get

mod: fix mod get
This commit is contained in:
Sam Alba 2021-11-04 11:06:42 -07:00 committed by GitHub
commit de6afee89c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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
}