mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-11-30 13:14:22 +01:00
use appRoot for current working directory
This commit is contained in:
1 parent
44df20e1f3
commit
14c2bb6ff2
1 file changed
+2
-2
@@ -27,7 +27,7 @@ func start(opts *Options) {
|
|||||||
signal.Notify(c, os.Interrupt, syscall.SIGTERM)
|
signal.Notify(c, os.Interrupt, syscall.SIGTERM)
|
||||||
|
|
||||||
//get current working directory
|
//get current working directory
|
||||||
dir,err := os.Getwd()
|
appRoot, err := os.Getwd()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println(err)
|
fmt.Println(err)
|
||||||
return
|
return
|
||||||
@@ -35,7 +35,7 @@ func start(opts *Options) {
|
|||||||
|
|
||||||
repoName := getLocalRepoName(opts.RepoURL)
|
repoName := getLocalRepoName(opts.RepoURL)
|
||||||
fmt.Printf("Cloning \x1b[37;1m%s\x1b[0m...\n", opts.RepoURL)
|
fmt.Printf("Cloning \x1b[37;1m%s\x1b[0m...\n", opts.RepoURL)
|
||||||
_, err = git.PlainClone(dir + "/" + repoName, false, &git.CloneOptions{
|
_, err = git.PlainClone(appRoot + "/" + repoName, false, &git.CloneOptions{
|
||||||
URL: opts.RepoURL,
|
URL: opts.RepoURL,
|
||||||
RecurseSubmodules: git.DefaultSubmoduleRecursionDepth,
|
RecurseSubmodules: git.DefaultSubmoduleRecursionDepth,
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in new issue
Block a user