#!/usr/bin/env bash

hookName=$(basename $0)
hookPathStart=$GL_ADMIN_BASE/hooks/common/.generated/$hookName
commonScope=$hookPathStart.common.*
repositoryScope=$hookPathStart.repository.$(echo $GL_REPO | sed "s/\//-/g").*

for hook in $(ls -1 $commonScope $repositoryScope)
do
  . $hook
done

#!/usr/bin/env bash

hookName=$(basename $0)
hooksRoot=$GL_ADMIN_BASE/hooks/common/.generated
repositoryName=$(echo $GL_REPO | sed "s/\//-/g")
hookPattern="^$hookName\.(common|repository\.$repositoryName)\."

for hook in $(ls -1 $hooksRoot | egrep $hookPattern)
do
  echo "Hooking $hook"
  . $hooksRoot/$hook
done

Update hooks runner to allow non-existent files and report running hooks
Update hooks runner to allow non-existent files and report running hooks