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;