6
0
mirror of https://github.com/grdl/git-get.git synced 2026-02-08 20:59:17 +00:00

Enable accessing config from gitconfig file or env variables

This commit is contained in:
Grzegorz Dlugoszewski
2020-05-29 21:19:55 +02:00
parent b72f984512
commit 1798816b6a
6 changed files with 270 additions and 6 deletions

View File

@@ -8,8 +8,6 @@ import (
"github.com/spf13/cobra"
)
const ReposRoot = "/tmp/gitget"
var cmd = &cobra.Command{
Use: "git-get <repo>",
Short: "git get",
@@ -19,14 +17,14 @@ var cmd = &cobra.Command{
}
func init() {
//cmd.PersistentFlags().
pkg.LoadConf()
}
func Run(cmd *cobra.Command, args []string) {
url, err := pkg.ParseURL(args[0])
exitIfError(err)
_, err = pkg.CloneRepo(url, ReposRoot, false)
_, err = pkg.CloneRepo(url, pkg.Cfg.ReposRoot(), false)
exitIfError(err)
}