From a2acbe32bf51ef06ee85c426b1f760b675e15637 Mon Sep 17 00:00:00 2001 From: Roger Keller Date: Sat, 28 Oct 2017 21:20:28 +0200 Subject: [PATCH] Make sure AppVersion is set without the -dirty suffix for non-dirty work trees regardless of where revel is run from. --- harness/build.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/harness/build.go b/harness/build.go index d2b92d7..10791e8 100755 --- a/harness/build.go +++ b/harness/build.go @@ -39,7 +39,7 @@ func Build(buildFlags ...string) (app *App, compileError *revel.Error) { // Add the db.import to the import paths. if dbImportPath, found := revel.Config.String("db.import"); found { - sourceInfo.InitImportPaths = append(sourceInfo.InitImportPaths, strings.Split(dbImportPath,",")...) + sourceInfo.InitImportPaths = append(sourceInfo.InitImportPaths, strings.Split(dbImportPath, ",")...) } // Generate two source files. @@ -210,7 +210,7 @@ func getAppVersion() string { if (err != nil && os.IsNotExist(err)) || !info.IsDir() { 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) output, err := gitCmd.Output()