29 lines
484 B
Go
29 lines
484 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
"os/exec"
|
|
"path"
|
|
"strings"
|
|
)
|
|
|
|
func main() {
|
|
repoURL := "https://git.greatrsingh.in/sudo-rsingh/examples.git"
|
|
repoName := path.Base(repoURL)
|
|
repoName = strings.TrimSuffix(repoName, ".git")
|
|
targetDir := "repo/" + repoName
|
|
|
|
cmd := exec.Command("git", "clone", repoURL, targetDir)
|
|
cmd.Stdout = os.Stdout
|
|
cmd.Stderr = os.Stderr
|
|
|
|
err := cmd.Run()
|
|
if err != nil {
|
|
fmt.Println("Error: ", err)
|
|
return
|
|
}
|
|
|
|
fmt.Println("Clone Completed.")
|
|
}
|