Commit b5329487 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge pull request #93 from raphendyr/patch-3

Remove hard coded home
parents 56e216f3 f457f974
......@@ -3,25 +3,19 @@
# $1 is an optional argument specifying the location of the repositories directory.
# Defaults to /home/git/repositories if not provided
home_dir="/home/git"
src=${1:-"$home_dir/repositories"}
src=${1:-"$HOME/repositories"}
function create_link_in {
ln -s -f "$home_dir/gitlab-shell/hooks/update" "$1/hooks/update"
ln -s -f "$HOME/gitlab-shell/hooks/update" "$1/hooks/update"
}
for dir in `ls "$src/"`
do
if [ -d "$src/$dir" ]; then
if [[ "$dir" =~ ^.*\.git$ ]]
then
create_link_in "$src/$dir"
for dir in "$src/"*; do
if [ -d "$dir" ]; then
if [ "$dir" != "${dir%.git}" ]; then
create_link_in "$dir"
else
for subdir in `ls "$src/$dir/"`
do
if [ -d "$src/$dir/$subdir" ] && [[ "$subdir" =~ ^.*\.git$ ]]; then
create_link_in "$src/$dir/$subdir"
fi
for subdir in "$dir/"*.git; do
create_link_in "$subdir"
done
fi
fi
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment