hhvn.uk

Website, gopher, etc
git clone https://hhvn.uk/hhvn.uk
git clone git://hhvn.uk/hhvn.uk
Log | Files | Refs | Submodules

stagit-gopher-create.rc (732B)


      1 #!/bin/rc
      2 
      3 d = `$nl{realpath `$nl{dirname $0}}
      4 
      5 # Add my dir to $path
      6 # This script should still be able to 
      7 # run if the binaries aren't installed.
      8 path = ($path $d/stagit-gopher)
      9 
     10 reposdir  = $d/../git
     11 repos     = $reposdir/*
     12 gopherdir = $d/../gopher
     13 stagitdir = /git/
     14 destdir   = $gopherdir ^ $stagitdir
     15 
     16 stagit-gopher-index -b $stagitdir $repos > $destdir/index.gph
     17 
     18 # Make repos
     19 for (repo in $repos) {
     20 	display = `$nl{basename $repo '.git'}
     21 	dest    = $destdir ^ $display
     22 
     23 	printf '%s... ' $display
     24 	@{
     25 		mkdir -p $dest
     26 		cd $dest
     27 		stagit-gopher -b $stagitdir/$display -l 75 -u 'gopher://hhvn.uk/'$display'/' $repo
     28 		sed -i '1,1s~$~\ngit clone git://hhvn.uk/'$base'/~' log.gph
     29 		ln -sf log.gph index.gph
     30 	}
     31 	printf 'done\n'
     32 }