From 0f98ea22fcc3f10cfd36aba66e531bf22c70f96e Mon Sep 17 00:00:00 2001 From: Evan You Date: Fri, 9 Oct 2015 20:58:45 -0400 Subject: [PATCH] fix git hook install check --- tools/tool-env/install-git-hooks.js | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/tools/tool-env/install-git-hooks.js b/tools/tool-env/install-git-hooks.js index adc596f41e..1fb75573c2 100644 --- a/tools/tool-env/install-git-hooks.js +++ b/tools/tool-env/install-git-hooks.js @@ -32,16 +32,14 @@ const METEOR_HOOK_SUFFIX = '.meteor-hook'; const METEOR_HOOK_LINE_REGEX = /.*meteor-hook.*/; export default function installGitHooks() { - // ensure the hooks folder is present - files.mkdir_p(hookDestination); + + if (!files.exists(hookDestination)) { + // Don't do anything if the hook destination does not exist, eg., + // we are not running from a git clone. + return; + } allPossibleHooks.map((hookName) => { - if (!files.exists(hookDestination)) { - // Don't do anything if the hook destination does not exist, eg., - // we are not running from a git clone. - return; - } - const hookFile = files.pathJoin(hookDestination, hookName); const sourceFile = files.pathJoin(hookSource, hookName); const meteorHookFile = hookFile + METEOR_HOOK_SUFFIX;