[hooks] Don't require vpython to be on PATH.

flatten_buildbucket_cfg has a shebang line that refers to vpython, but
we can just handle it in the script so users that don't have it in their
path are not thwarted when trying to commit.

Test: Copied this into infra/config/.git/hooks and commited something.
Change-Id: I50947566e9356e2842b1ea369e19e94970b9cbb1
diff --git a/infra-git-hooks/pre-commit b/infra-git-hooks/pre-commit
index 8d7d77e..80de12c 100755
--- a/infra-git-hooks/pre-commit
+++ b/infra-git-hooks/pre-commit
@@ -10,9 +10,16 @@
 
 # Assume directory layout as created by infra manifest, and CWD is inside a
 # config dir, like fuchsia-infra/config.
-FLATTEN_TOOL="../../fuchsia-infra/prebuilt/tools/flatten_buildbucket_cfg/flatten_buildbucket_cfg"
-if [[ ! -x "${FLATTEN_TOOL}" ]]; then
-  echo "Expected the following path to be an executable file, but it's not: ${FLATTEN_TOOL}"
+TOOLS_DIR="../../fuchsia-infra/prebuilt/tools"
+FLATTEN_TOOL="${TOOLS_DIR}/flatten_buildbucket_cfg/flatten_buildbucket_cfg"
+if [[ ! -f "${FLATTEN_TOOL}" ]]; then
+  echo "Expected the following path to be a regular file, but it's not: ${FLATTEN_TOOL}"
+  exit 1
+fi
+
+VPYTHON="${TOOLS_DIR}/vpython"
+if [[ ! -x "${VPYTHON}" ]]; then
+  echo "Expected the following path to be an executable file, but it's not: ${VPYTHON}"
   exit 1
 fi
 
@@ -42,7 +49,7 @@
     fi
     if [[ "${STATUS}" =~ [AM] ]]; then
       mkdir -p $(dirname "${GENERATED_FILE}")
-      "${FLATTEN_TOOL}" "${FILE}" > "${GENERATED_FILE}"
+      "${VPYTHON}" "${FLATTEN_TOOL}" "${FILE}" > "${GENERATED_FILE}"
       git add "${GENERATED_FILE}"
     fi
   fi