shithub: shithub

ref: 7c3ef1d4f6ff9b6dfcc96d4b0bce2c93cdc1d069
dir: /list/

View raw version
#!/bin/rc

. /sys/lib/shithub/common.rc

cd $1
shift

rfork ne
nl='
'

http_response
prelude '' 'the fragrant git host'
echo '<img src="/'$logo'" /><br/>'

if(~ $#intro 0)
	echo '<h2>Repositories</h2><br/>'
if not
	echo $intro

udir=()
for(repo in `$nl{ls */}){
	ndir=`{basename -d $repo}
	if(! ~ $udir $ndir)
		echo '</dl>'
	if(! ~ $udir $ndir){
		echo '<h3>'$ndir'</h3>'
		echo '<dl>'
		udir=$ndir
	}
	if(test -e $repo/.git/webpublish){
		echo '<dt><a href="/'$repo'/">'$repo'</a></dt>'
		echo '<dd>'
		if(test -f $repo/.git/desc)
			htcat $repo/.git/desc
		if not if(test -f $repo/.git/description)
			htcat $repo/.git/description
		if not
			echo 'probably some code'
		echo '</dd>'
	}
}