Skip to content

Commit

Permalink
git output to stderr (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
juev authored Dec 30, 2024
2 parents 25cc428 + b11508f commit a5b72e9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.vscode
data
gclone
temp
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ function gcd --argument repo
echo "argument is empty"
return
end
cd $(gclone -q $argv[1])
cd $(gclone $argv[1])
end
```

Expand All @@ -60,7 +60,7 @@ function gcode --argument repo
echo "argument is empty"
return
end
code $(gclone -q $argv[1])
code $(gclone $argv[1])
end
```

Expand Down
11 changes: 6 additions & 5 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ import (
)

var (
version = "0.3.3"
version = "0.3.4"
commit = "none"
date = "unknown"
)

var r = regexp.MustCompile(`^(?:.*://)?(?:[^@]+@)?([^:/]+)(?::\d+)?(?:/|:)?(.*)$`)
var r = regexp.MustCompile(`^(?:.*://)?(?:[^@]+@)?([^:/]+)(?::\d+)?[/:]?(.*)$`)

func main() {
var showCommandHelp, showVersionInfo, quiet bool
Expand Down Expand Up @@ -62,7 +62,7 @@ func main() {

cmd := exec.Command("git", "clone", repository)
if !quiet {
cmd.Stdout = os.Stdout
cmd.Stdout = os.Stderr
cmd.Stderr = os.Stderr
}
cmd.Dir = filepath.Dir(projectDir)
Expand All @@ -71,12 +71,13 @@ func main() {
continue
}
if !quiet {
fmt.Println()
fmt.Fprintln(os.Stderr)
}
}

// Print latest project directory
fmt.Println(projectDir)
abs, _ := filepath.Abs(projectDir)
fmt.Println(abs)
}

// normalize normalizes the given repository string and returns the parsed repository URL.
Expand Down

0 comments on commit a5b72e9

Please sign in to comment.