#!/bin/sh -e add_repo() {( _dir="$(basename "$1")" if [ -d "code/${_dir}" ] then ( cd code/${_dir} && git pull ) else ( cd code && git clone "https://$1" ) fi _fulldir=$(readlink -f "code/${_dir}") mkdir -p www/code/${_dir} cp site/code/*.{css,png} www/code/${_dir}/ cd www/code/${_dir} stagit -u https://stefanhagen.de/code ${_fulldir} )} mkdir -p code add_repo "github.com/c0dev0id/dotfiles" add_repo "github.com/c0dev0id/mkpicindex" add_repo "github.com/c0dev0id/mystuff" add_repo "github.com/c0dev0id/website" add_repo "github.com/c0dev0id/xpick" add_repo "github.com/luakit/luakit" _repos="$(find code/* -mindepth 0 -maxdepth 0 -type d)" stagit-index ${_repos} > www/code/index.html