Get base also correctly on windows
by stripping the *.exe extension, if present.
This commit is contained in:
parent
5e8edcf3b5
commit
0400ed0a68
2
main.go
2
main.go
|
@ -11,7 +11,7 @@ import (
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
gitroot, _ := filepath.Abs(filepath.Dir(general.GetGitRoot()))
|
gitroot, _ := filepath.Abs(filepath.Dir(general.GetGitRoot()))
|
||||||
hookBase := filepath.Base(os.Args[0])
|
hookBase := strings.TrimSuffix(filepath.Base(os.Args[0]), filepath.Ext(os.Args[0]))
|
||||||
hookPrefix := fmt.Sprintf("%s_", hookBase)
|
hookPrefix := fmt.Sprintf("%s_", hookBase)
|
||||||
os.Chdir(gitroot)
|
os.Chdir(gitroot)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user