wm: infra

ref: aa6e00143a552cb9d990cee2241008d353066520
dir: /doc/txt/

View raw version
#!/bin/rc -e

. /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
}

if(! test -d $gitfs/$ref/tree){
	echo 'No such document'
	exit
}

cd $gitfs/$ref/tree
nroff -ms $gitfs/$ref/tree/$file.ms | col -bf