dot

packages and services management
Log | Files | Refs | README

commit 49327f6cfe893dc6577d73ecdcd7ec2d63dc6044
parent cd3b90ed6832253b9f6caca12e149b347c2e04f3
Author: Josuah Demangeon <mail@josuah.net>
Date:   Sun, 13 Jan 2019 00:24:27 +0100

Merge branch 'master' of git.josuah.net:dot

Diffstat:
Mbin/git-newrepo | 11++++++-----
Mconf/git | 3++-
Aetc/git/blog/hooks/post-receive.d/blog | 39+++++++++++++++++++++++++++++++++++++++
Retc/git/public/env/PATH_WWW -> etc/git/default/env/PATH_WWW | 0
Aetc/git/pack/hooks/post-receive.d/pack | 11+++++++++++
5 files changed, 58 insertions(+), 6 deletions(-)

diff --git a/bin/git-newrepo b/bin/git-newrepo @@ -1,10 +1,11 @@ #!/usr/bin/env execlineb - -importas -i type 1 -importas -i repo 2 -importas -i desc 3 +multisubstitute { + importas -is -d , type 1 + importas -i repo 2 + importas -i desc 3 +} if { git init --bare /var/git/${repo} } if { s6-hiercopy /etc/git/default /var/git/${repo} } -if { s6-hiercopy /etc/git/${type} /var/git/${repo} } +if { forx x { ${type} } importas x x s6-hiercopy /etc/git/${x} /var/git/${repo} } if { redirfd -w 1 /var/git/${repo}/description echo ${desc} } diff --git a/conf/git b/conf/git @@ -11,5 +11,6 @@ if { git-newrepo public plstree "display ls or ps output as a tree" } if { git-newrepo public tttml "formatter for a very basic markup format" } if { git-newrepo public sites "mirror of git://git.suckless.org/sites" } if { git-newrepo public pack "[WIP] dead simple source-based package manager" } -if { git-newrepo public packages "packages recipes for the <noname> package manager" } if { git-newrepo public s6-mk "services definition for the s6-rc service manager" } +if { git-newrepo public,pack packages "packages recipes for the <noname> package manager" } +if { git-newrepo blog blog "blog posts" } diff --git a/etc/git/blog/hooks/post-receive.d/blog b/etc/git/blog/hooks/post-receive.d/blog @@ -0,0 +1,39 @@ +#!/usr/bin/env execlineb +elgetpositionals + +define path /var/www/josuah.net + +if { + pipeline { git archive --format=tar master } + tar -xf - -C ${path}/blog +} + +if { + redirfd -w 1 ${path}/index.html + if { cat ${path}/head.html } + if { echo "<ul>" } + if { + forbacktickx -n x { pipeline { git ls-tree --full-tree master } sed "s/.*\t//" } + importas post x + + backtick -n x { pipeline { git cat-file blob master:${post} } sed q } + importas title x + + echo "<li><a href=\"/blog/${post}\">${title}</a></li>" + } + if { echo "</ul>" } +} + +if { + redirfd -w 1 ${path}/index.gph + if { cat ${path}/head.gph } + if { + forbacktickx -n x { pipeline { git ls-tree --full-tree master } sed "s/.*\t//" } + importas post x + + backtick -n x { pipeline { git cat-file blob master:${post} } sed q } + importas title x + + echo "[0|${title}|/blog/${post}|server|port]" + } +} diff --git a/etc/git/public/env/PATH_WWW b/etc/git/default/env/PATH_WWW diff --git a/etc/git/pack/hooks/post-receive.d/pack b/etc/git/pack/hooks/post-receive.d/pack @@ -0,0 +1,11 @@ +#!/usr/bin/env execlineb +elgetpositionals + +if { + pipeline { git archive --format=tar } + tar -xf - -C /var/www/josuah.net/pack } +} + +cd /var/www/josuah.net/pack +redirfd -w 1 index.html +ltree-html