Skip to content

Commit

Permalink
feat(wip): clone command
Browse files Browse the repository at this point in the history
  • Loading branch information
joshmedeski committed Aug 23, 2024
1 parent 623648a commit 2886c9c
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
9 changes: 9 additions & 0 deletions git/git.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
type Git interface {
ShowTopLevel(name string) (bool, string, error)
GitCommonDir(name string) (bool, string, error)
Clone(name string) (string, error)
}

type RealGit struct {
Expand All @@ -32,3 +33,11 @@ func (g *RealGit) GitCommonDir(path string) (bool, string, error) {
}
return true, out, nil
}

func (g *RealGit) Clone(name string) (string, error) {
out, err := g.shell.Cmd("git", "clone", name)
if err != nil {
return "", err
}
return out, nil
}
7 changes: 7 additions & 0 deletions model/git.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package model

type GitCloneOptions struct {
Dir string
CmdDir string
Repo string
}
4 changes: 4 additions & 0 deletions seshcli/clone.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package seshcli

import (
"fmt"

cli "github.com/urfave/cli/v2"
)

Expand All @@ -18,6 +20,8 @@ func Clone() *cli.Command {
},
},
Action: func(cCtx *cli.Context) error {
// TODO: implement clone command
fmt.Println("Clone command coming soon to sesh v2")
return nil
},
}
Expand Down

0 comments on commit 2886c9c

Please sign in to comment.