From 78eb8ba844b5ccb23644274481e18370dd8428e3 Mon Sep 17 00:00:00 2001 From: Yuri Kunde Schlesner Date: Sat, 19 Jul 2014 17:16:05 -0300 Subject: [build] Search for the git binary in the default msysgit install dir The Git for Windows installer doesn't add the Git binaries to the path by default. (Due to risk of conflicts with built-in windows commands.) Unless you have configured your system specially this causes the scm_rev_gen.js script to fail to find Git. Added more paths to the script so that it searches in the default msysgit installation directory, eliminating the need to set the PATH for most environments. --- src/common/scm_rev_gen.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/common/scm_rev_gen.js b/src/common/scm_rev_gen.js index 29c913b85..98313e376 100644 --- a/src/common/scm_rev_gen.js +++ b/src/common/scm_rev_gen.js @@ -6,8 +6,15 @@ var cmd_revision = " rev-parse HEAD"; var cmd_describe = " describe --always --long --dirty"; var cmd_branch = " rev-parse --abbrev-ref HEAD"; +var git_search_paths = { + "git.cmd": 1, + "git": 1, + "C:\\Program Files (x86)\\Git\\bin\\git.exe": 1, + "C:\\Program Files\\Git\\bin\\git.exe": 1 +}; + function GetGitExe() { - for (var gitexe in { "git.cmd": 1, "git": 1 }) { + for (var gitexe in git_search_paths) { try { wshShell.Exec(gitexe); return gitexe; -- cgit v1.2.3