Skip to content

Commit ec1b70f

Browse files
authored
Merge pull request #4 from jason-dour/bugfix-3
Bugfix 3
2 parents 71e455e + 3df798a commit ec1b70f

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.3.0
1+
0.3.1

internal/cobra/cl/command.go

+9-2
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,16 @@ func run(cmd *cobra.Command, args []string) error {
4141
cmn.Debug("%s: run: defaultBranch: %v", command, defaultBranch)
4242

4343
// Define clone path.
44+
repo := ""
45+
clonePath := ""
4446
basename := filepath.Base(args[0])
45-
repo := strings.TrimSuffix(basename, filepath.Ext(basename))
46-
clonePath := filepath.Join(repo, defaultBranch)
47+
48+
if strings.HasSuffix(basename, ".git") {
49+
repo = strings.TrimSuffix(basename, ".git")
50+
} else {
51+
repo = basename
52+
}
53+
clonePath = filepath.Join(repo, defaultBranch)
4754

4855
// Clone the repository.
4956
err = git.Clone(args[0], defaultBranch, clonePath)

0 commit comments

Comments
 (0)