Skip to content

Commit

Permalink
Merge pull request #108 from lionskape/fix/git-execution-conisistency…
Browse files Browse the repository at this point in the history
…_windows

Fix execution on windows
  • Loading branch information
Abroskin Alexander authored Jan 28, 2020
2 parents d864a80 + 2747fcb commit 094d3f4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cmd/add.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ func addLocalHookDir(hookName string, fs afero.Fs) {
}

func getGitHooksDir() string {
cmd := exec.Command("sh", "-c", "git rev-parse --git-common-dir")
cmd := exec.Command("git", "rev-parse", "--git-common-dir")

outputBytes, err := cmd.CombinedOutput()
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"log"
"os"
"os/exec"
"strings"
"path/filepath"
"strings"

"github.com/logrusorgru/aurora"
"github.com/mattn/go-isatty"
Expand Down Expand Up @@ -109,7 +109,7 @@ func getRootPath() string {

func setRootPath(path string) {
// get absolute path to .git dir (project root)
cmd := exec.Command("sh", "-c", "git rev-parse --show-toplevel")
cmd := exec.Command("git", "rev-parse", "--show-toplevel")

outputBytes, err := cmd.CombinedOutput()
check(err)
Expand Down

0 comments on commit 094d3f4

Please sign in to comment.