Get base also correctly on windows

by stripping the *.exe extension, if present.
This commit is contained in:
Ingo Oeser 2015-08-23 00:16:22 +02:00
parent 5e8edcf3b5
commit 0400ed0a68

View File

@ -11,7 +11,7 @@ import (
func main() {
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)
os.Chdir(gitroot)