summaryrefslogtreecommitdiff
path: root/bin/aux/bpst.rc
diff options
context:
space:
mode:
authorPeter Mikkelsen <petermikkelsen10@gmail.com>2024-04-07 13:25:49 +0200
committerPeter Mikkelsen <petermikkelsen10@gmail.com>2024-04-07 13:25:49 +0200
commit9cb56dabb676391a9382731347e8d2b07b9437a5 (patch)
tree95302f041497679202722d9896ec1386bed2d86c /bin/aux/bpst.rc
parent0a37a1cc5909e11098963267edc9654b85e7ce16 (diff)
big cleanup
Diffstat (limited to 'bin/aux/bpst.rc')
-rwxr-xr-xbin/aux/bpst.rc64
1 files changed, 0 insertions, 64 deletions
diff --git a/bin/aux/bpst.rc b/bin/aux/bpst.rc
deleted file mode 100755
index e60d034..0000000
--- a/bin/aux/bpst.rc
+++ /dev/null
@@ -1,64 +0,0 @@
-#!/bin/rc
-
-path=( $PLAN9/bin $path )
-base=.
-
-if(~ $#user 0)
- user=`{whoami}
-
-file=(); title=();
-bloguser=$user
-while(! ~ $#* 0) {
- switch($1) {
- case -u
- base=/gsoc/www/people/$user/blog/
- case -b
- shift
- base=$1
- case -f
- shift
- file=$1
- }
- shift
-}
-
-if(~ $"EDITOR '')
- EDITOR=vi
-
-if(~ $#file 0 || ! test -f $file) {
- file=/tmp/blogtmp.$pid
- rm $file >[2]/dev/null
- touch $file
-}
-
-$EDITOR $file
-ispell $file
-rm $file.bak >[2]/dev/null
-
-fn mkbpost {
- umask 002 # Let group write
- bptext=$1
- if(! ~ $#2 0)
- bpid=`{echo -n '-'^$"bpid | sed 's/'$forbidden_uri_chars'+/_/g; 1q'}
- d=`{/bin/date +%F|sed 's,-,/,g'}
-
- ddir=$blagh_root^$d^'/'
- n=`{ls $ddir >[2]/dev/null |wc -l}
-
- mkdir -p $ddir/$"n^$"bpid/
- {
- # TODO: Enable metadata
- #echo '* Posted:' `{date}
- #if(! ~ $#logged_user 0)
- # echo '* Author: '$logged_user
- cat $bptext
- }> $ddir/$"n^$"bpid/index.md
-}
-
-forbidden_uri_chars='[^a-zA-Z0-9_+\-\/\.]'
-blagh_root=$base
-
-if(test -s $file)
- mkbpost $file
-if not
- echo Empty file!