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

Make the URL scheme default to ssh instead of https and make it configurable

This commit is contained in:
Grzegorz Dlugoszewski
2020-09-02 03:14:01 +02:00
parent ccbee82f0b
commit 0d797d625a
5 changed files with 84 additions and 57 deletions

View File

@@ -8,12 +8,13 @@ import (
// GetCfg provides configuration for the Get command.
type GetCfg struct {
Branch string
DefHost string
Dump string
Root string
SkipHost bool
URL string
Branch string
DefHost string
DefScheme string
Dump string
Root string
SkipHost bool
URL string
}
// Get executes the "git get" command.
@@ -33,7 +34,7 @@ func Get(c *GetCfg) error {
}
func cloneSingleRepo(c *GetCfg) error {
url, err := ParseURL(c.URL, c.DefHost)
url, err := ParseURL(c.URL, c.DefHost, c.DefScheme)
if err != nil {
return err
}
@@ -56,7 +57,7 @@ func cloneDumpFile(c *GetCfg) error {
}
for _, line := range parsedLines {
url, err := ParseURL(line.rawurl, c.DefHost)
url, err := ParseURL(line.rawurl, c.DefHost, c.DefScheme)
if err != nil {
return err
}