stagit-gopher

[fork] gopher git frontend
Log | Files | Refs | README | LICENSE

create.rc (729B)


      1 #!/bin/rc
      2 
      3 # Add my dir to $path
      4 # This script should still be able to 
      5 # run if the binaries aren't installed.
      6 path = ($path `$nl{dirname $0})
      7 
      8 reposdir  = /srv/git
      9 repos     = $reposdir/*
     10 gopherdir = /srv/zfs/net
     11 stagitdir = /git/o/
     12 destdir   = $gopherdir ^ $stagitdir
     13 
     14 # Make index
     15 if (test -f $reposdir/info) {
     16 	cp $reposdir/info $destdir/index.gph
     17 } else {
     18 	rm $destdir/index.gph
     19 }
     20 stagit-gopher-index -b $stagitdir $repos | tail -n +2 >> $destdir/index.gph
     21 
     22 # Make repos
     23 for (repo in $repos) {
     24 	display = `$nl{basename $repo '.git'}
     25 	dest    = $destdir ^ $display
     26 
     27 	printf '%s... ' $display
     28 	@{
     29 		mkdir -p $dest
     30 		cd $dest
     31 		stagit-gopher -b $stagitdir/$display -l 75 $repo
     32 		ln -sf log.gph index.gph
     33 	}
     34 	printf 'done\n'
     35 }