turn git-porno into a sexy git.1 wrapper - git-porno - Git Porno HTML git clone git://bitreich.org/git-porno git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/git-porno DIR Log DIR Files DIR Refs DIR Tags DIR README DIR LICENSE --- DIR commit fb8138ace9be3841035220c0a61080e3e6d4b81c DIR parent 7faa708066bdbf229d82fa9eac46681baecbe966 HTML Author: Anders Damsgaard <anders@adamsgaard.dk> Date: Wed, 18 Oct 2023 19:58:01 +0200 turn git-porno into a sexy git.1 wrapper Signed-off-by: Christoph Lohmann <20h@r-36.net> Diffstat: M Makefile | 19 ++++++++++++++++--- M git-porno | 23 ++++++++++++++++++++++- A media/git-add.opus | 0 A media/git-checkout.opus | 0 A media/git-cherry-pick.opus | 0 A media/git-diff.opus | 0 A media/git-log.opus | 0 A media/git-pull.opus | 0 A media/git-push.opus | 0 A media/git-reset.opus | 0 A media/git-shortlog.opus | 0 11 files changed, 38 insertions(+), 4 deletions(-) --- DIR diff --git a/Makefile b/Makefile @@ -3,6 +3,16 @@ NAME = git-porno VERSION = 0.1 +MEDIA =\ + media/git-add.opus\ + media/git-checkout.opus\ + media/git-cherry-pick.opus\ + media/git-diff.opus\ + media/git-log.opus\ + media/git-pull.opus\ + media/git-push.opus\ + media/git-reset.opus\ + media/git-shortlog.opus\ # Customize below to fit your system @@ -21,11 +31,14 @@ dist: rm -rf ${NAME}-${VERSION} install: - mkdir -p '${DESTDIR}${PREFIX}/bin' - cp ${NAME} '${DESTDIR}${PREFIX}/bin' + mkdir -p "${DESTDIR}${PREFIX}/bin" + cp ${NAME} "${DESTDIR}${PREFIX}/bin" + mkdir -p "${DESTDIR}${PREFIX}/share/${NAME}" + cp -f ${MEDIA} ${DESTDIR}${PREFIX}/share/${NAME}/ uninstall: - rm -f '${DESTDIR}${PREFIX}/bin/${NAME}' + rm -f "${DESTDIR}${PREFIX}/bin/${NAME}" + rm -rf "${DESTDIR}${PREFIX}/share/${NAME}/" .PHONY: all dist install uninstall DIR diff --git a/git-porno b/git-porno @@ -1,4 +1,25 @@ #!/bin/sh -mpv gophers://bitreich.org/9/memecache/git-porno.mkv +mediadir="${GIT_PORNO_MEDIA:-/usr/local/share/git-porno}" +git_porno_cmd() { + if ! test -d "$mediadir" + then + printf "error: could not find GIT_PORNO_DIR\n" >&2 + exit 1 + fi + mpv --really-quiet --force-window=no --no-video "${mediadir}/git-$1.opus" & + eval git "$@" +} + +if test $# -gt 0 +then + case $1 in + add|checkout|cherry-pick|diff|log|pull|push|reset|shortlog) + git_porno_cmd "$@";; + *) + eval git "$@";; + esac +else + mpv gophers://bitreich.org/9/memecache/git-porno.mkv +fi DIR diff --git a/media/git-add.opus b/media/git-add.opus Binary files differ. DIR diff --git a/media/git-checkout.opus b/media/git-checkout.opus Binary files differ. DIR diff --git a/media/git-cherry-pick.opus b/media/git-cherry-pick.opus Binary files differ. DIR diff --git a/media/git-diff.opus b/media/git-diff.opus Binary files differ. DIR diff --git a/media/git-log.opus b/media/git-log.opus Binary files differ. DIR diff --git a/media/git-pull.opus b/media/git-pull.opus Binary files differ. DIR diff --git a/media/git-push.opus b/media/git-push.opus Binary files differ. DIR diff --git a/media/git-reset.opus b/media/git-reset.opus Binary files differ. DIR diff --git a/media/git-shortlog.opus b/media/git-shortlog.opus Binary files differ.