def _run_hook_from_repo_dir(repo_dir, hook_name, project_dir, context):
 with work_in(repo_dir):
  try:
   run_hook(hook_name, project_dir, context)
  except FailedHookException:
   rmtree(project_dir)
   logger.error(u"Stopping generation because {} hook script didn't exit successfully".format(hook_name))
   raise

def _run_hook_from_repo_dir ( repo_dir , hook_name , project_dir , context ) : with work_in ( repo_dir ) : try : run_hook ( hook_name , project_dir , context ) except FailedHookException : rmtree ( project_dir ) logger . error ( u"Stopping generation because {} hook script didn't exit successfully" . format ( hook_name ) ) raise
run hook from repo directory .