From 0400ed0a68e77fc1ee032416106bc12d088f0b63 Mon Sep 17 00:00:00 2001 From: Ingo Oeser Date: Sun, 23 Aug 2015 00:16:22 +0200 Subject: [PATCH] Get base also correctly on windows by stripping the *.exe extension, if present. --- main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.go b/main.go index 2ee4401..804a385 100644 --- a/main.go +++ b/main.go @@ -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)