Make sure AppVersion is set without the -dirty suffix for non-dirty work trees regardless of where revel is run from.

This commit is contained in:
Roger Keller
2017-10-28 21:20:28 +02:00
parent f38fb6a15d
commit a2acbe32bf

View File

@@ -210,7 +210,7 @@ func getAppVersion() string {
if (err != nil && os.IsNotExist(err)) || !info.IsDir() { if (err != nil && os.IsNotExist(err)) || !info.IsDir() {
return "" return ""
} }
gitCmd := exec.Command(gitPath, "--git-dir="+gitDir, "describe", "--always", "--dirty") gitCmd := exec.Command(gitPath, "--git-dir="+gitDir, "--work-tree="+revel.BasePath, "describe", "--always", "--dirty")
revel.RevelLog.Debug("Exec:", "args", gitCmd.Args) revel.RevelLog.Debug("Exec:", "args", gitCmd.Args)
output, err := gitCmd.Output() output, err := gitCmd.Output()