fix: nits

This commit is contained in:
morelazers 2023-05-29 15:25:04 +02:00
parent df55f91988
commit 531c00b19c
3 changed files with 2 additions and 97 deletions

View File

@ -1,68 +0,0 @@
/- blog-paths, *blog
/+ default-agent, dbug, *sss, verb
=/ sub-paths (mk-subs blog-paths ,[%paths ~])
::
|%
+$ card card:agent:gall
--
%- agent:dbug
%+ verb &
^- agent:gall
|_ =bowl:gall
+* this .
default ~(. (default-agent this %.n) bowl)
da-blog-paths =/ da (da blog-paths ,[%paths ~])
(da sub-paths bowl -:!>(*result:da) -:!>(*from:da) -:!>(*fail:da))
++ on-init
^- (quip card _this)
`this
::
++ on-save !>(sub-paths)
++ on-load
|= =vase
:- ~
=/ old !<(=_sub-paths vase)
this(sub-paths sub-paths.old)
::
++ on-poke
|= [=mark =vase]
^- (quip card _this)
?+ mark `this
%blog-sub
=/ sub !<([%sub =ship] vase)
=^ cards sub-paths (surf:da-blog-paths ship.sub %blog [%paths ~])
[cards this]
::
%sss-blog-paths
=^ cards sub-paths (apply:da-blog-paths !<(into:da-blog-paths (fled vase)))
[cards this]
::
%sss-on-rock
`this
==
++ on-watch on-watch:default
++ on-leave on-leave:default
++ on-peek on-peek:default
++ on-agent
|= [=wire =sign:agent:gall]
^- (quip card:agent:gall _this)
?> ?=(%poke-ack -.sign)
?~ p.sign `this
%- (slog u.p.sign)
?+ wire `this
[~ %sss %on-rock @ @ @ %paths ~]
=. sub-paths (chit:da-blog-paths |3:wire sign)
`this
::
[~ %sss %scry-request @ @ @ %paths ~]
=^ cards sub-paths (tell:da-blog-paths |3:wire sign)
[cards this]
==
++ on-arvo
|= [=wire sign=sign-arvo]
^- (quip card:agent:gall _this)
?+ wire `this
[~ %sss %behn @ @ @ %paths ~] [(behn:da-blog-paths |3:wire) this]
==
++ on-fail on-fail:default
--

View File

@ -1,6 +1,5 @@
/- blog, blog-paths
/+ blog-lib=blog, dbug, default-agent, *sss, verb
=/ pub-paths (mk-pubs blog-paths ,[%paths ~])
::
%- agent:dbug
%+ verb &
@ -28,7 +27,7 @@
drafts=(map path md=@t)
themes=(map @tas css=@t)
uri=@t
=_pub-paths
=_(mk-pubs blog-paths ,[%paths ~])
==
+$ card $+(card card:agent:gall)
--
@ -106,7 +105,6 @@
[200 ['Content-Type' 'text/plain; charset=utf-8']~]
`(as-octs:mimes:^html md)
== ==
==
::
++ on-poke
@ -129,7 +127,7 @@
[200 ['Content-Type' 'text/plain; charset=utf-8']~]
`(as-octs:mimes:html md.act)
==
::
:* %pass /bind %arvo %e
%set-response (spat path.act)
~ %.n %payload

View File

@ -1,25 +0,0 @@
#!/bin/bash
usage() { printf "Usage: $0 [-w] URBIT_PIER_DIRECTORY \n(-w: flag to watch and live copy code)\n" 1>&2; exit 1; }
if [ $# -eq 0 ]; then
usage
exit 2
fi
PIER=$1
while getopts "w" opt; do
case ${opt} in
w) WATCH_MODE="true"
PIER=$2
;;
*) usage
;;
esac
done
echo "Watching for changes to copy to ${PIER}..."
while [ 0 ]
do
sleep 0.8
rsync -L -r --exclude '.*' --exclude '*.sh' * $PIER/
done