#!/bin/rc . /sys/lib/shithub/common.rc cd $1 shift rfork ne nl=' ' gituser=$1 repo=$2 refname=$3 file=$4 repons $gituser $repo if(! ref=`{resolveref $refname}){ echo 'invalid ref '$refname'' exit } cd $gitfs/$ref/tree if(~ $file '') file='.' hash=`{cat $gitfs/$ref/hash} http_response user_prelude $gituser $repo $hash echo '

ref: '$hash'
raw: view

' echo /$gituser/$repo/browse/$hash $repo /$file |breadcrumb if(test -f $file){ type=`{file -m $file} switch($type){ case text/* echo '
'
		htcat $file
		echo '	
' case image/* echo '
' case * echo '

Binary file not displayed

' } } echo ' '