aboutsummaryrefslogblamecommitdiffstats
path: root/roles/stagit/files/generate-static-git.sh
blob: dd0db3296cd09896648a822e3d6332acd2123676 (plain) (tree)
1
2
3
4
5
6
7
8
9
10









                                                        
                                                 





                                                         
                             









                                                                    
#!/bin/sh

GIT_DIR="/data/git"

repositories=""
repo=""

for repo in "${GIT_DIR}"/*; do

	if [ ! -f "${repo}/git-daemon-export-ok" ]; then
		echo " [ERR] $(basename ${repo})"
		continue
	fi

	repo=$(basename "${repo}")
	repositories="${repositories} ${GIT_DIR}/${repo}"

	echo " [OK ] ${repo}"
	mkdir "${repo}" 2>/dev/null
	(cd "${repo}" && /usr/local/bin/stagit "${GIT_DIR}/${repo}")
done

if [ -z "$repositories" ]; then
	exit 1
fi

echo " [#] ${repositories}"
/usr/local/bin/stagit-index ${repositories} > index.html
remember that computers suck.