From: Dan Hersam Date: Wed, 28 Jan 2015 01:09:10 +0000 (-0500) Subject: Version uses binary name instead of hugo X-Git-Tag: v0.13~97 X-Git-Url: http://git.maquefel.me//?a=commitdiff_plain;h=2d8e15a5651408fe40b7365334625c487625a1e0;p=brevno-suite%2Fhugo Version uses binary name instead of hugo On Windows the binary name is hugo.exe and running hugo version results in this error: GetFileAttributesEx D:\Dev\Go\gopath\bin\hugo: The system cannot find the file specified. This fixes that error and allows the binary name to be something other than hugo on any OS. --- diff --git a/commands/version.go b/commands/version.go index 41ada569..799ff70d 100644 --- a/commands/version.go +++ b/commands/version.go @@ -58,7 +58,7 @@ func setBuildDate() { fmt.Println(err) return } - fi, err := os.Lstat(filepath.Join(dir, "hugo")) + fi, err := os.Lstat(filepath.Join(dir, filepath.Base(fname))) if err != nil { fmt.Println(err) return