6
0
mirror of https://github.com/grdl/git-get.git synced 2026-02-07 05:30:39 +00:00

Add ssh credentials callback when cloning via ssh protocol

This commit is contained in:
Grzegorz Dlugoszewski
2020-05-26 10:34:36 +02:00
parent a530b1506c
commit 7ab4489dfe
5 changed files with 124 additions and 12 deletions

View File

@@ -2,14 +2,33 @@ package main
import (
"fmt"
"git-get/pkg"
"os"
"github.com/spf13/cobra"
)
const ReposRoot = "/tmp/gitget"
var cmd = &cobra.Command{
Use: "git-get",
Short: "git get",
Use: "git-get",
Short: "git get",
RunE: Run,
Version: "0.0.0",
}
func init() {
//cmd.PersistentFlags().
}
func Run(cmd *cobra.Command, args []string) error {
url, err := pkg.ParseURL(args[0])
if err != nil {
return err
}
_, err = pkg.CloneRepo(url, ReposRoot)
return err
}
func Execute() {