feat: Add --remote (#1387)
Co-authored-by: anqiansong <anqiansong@bytedance.com>
This commit is contained in:
@@ -52,7 +52,16 @@ func ApiCommand(c *cli.Context) error {
|
||||
}
|
||||
defer fp.Close()
|
||||
|
||||
|
||||
home := c.String("home")
|
||||
remote := c.String("remote")
|
||||
if len(remote) > 0 {
|
||||
repo, _ := util.CloneIntoGitHome(remote)
|
||||
if len(repo) > 0 {
|
||||
home = repo
|
||||
}
|
||||
}
|
||||
|
||||
if len(home) > 0 {
|
||||
util.RegisterGoctlHome(home)
|
||||
}
|
||||
|
||||
@@ -31,6 +31,13 @@ func GoCommand(c *cli.Context) error {
|
||||
dir := c.String("dir")
|
||||
namingStyle := c.String("style")
|
||||
home := c.String("home")
|
||||
remote := c.String("remote")
|
||||
if len(remote) > 0 {
|
||||
repo, _ := util.CloneIntoGitHome(remote)
|
||||
if len(repo) > 0 {
|
||||
home = repo
|
||||
}
|
||||
}
|
||||
|
||||
if len(home) > 0 {
|
||||
util.RegisterGoctlHome(home)
|
||||
|
||||
@@ -65,6 +65,14 @@ func CreateServiceCommand(c *cli.Context) error {
|
||||
defer fp.Close()
|
||||
|
||||
home := c.String("home")
|
||||
remote := c.String("remote")
|
||||
if len(remote) > 0 {
|
||||
repo, _ := util.CloneIntoGitHome(remote)
|
||||
if len(repo) > 0 {
|
||||
home = repo
|
||||
}
|
||||
}
|
||||
|
||||
if len(home) > 0 {
|
||||
util.RegisterGoctlHome(home)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user