dot

packages and services management
Log | Files | Refs | README

commit 84111cc59274042188ce70924680d8b02b10257a
parent 64624a7ce7c044479bc97f6ffcdf28a593b47675
Author: Josuah Demangeon <mail@josuah.net>
Date:   Fri, 16 Feb 2018 00:41:15 +0100

tpl: stupid template system

Diffstat:
Mbin/epih | 6+++---
Mbin/git-status | 4++--
Mbin/log | 2+-
Mbin/qemu | 2+-
Mbin/ssh-paste | 2+-
Abin/tpl | 5+++++
Mbin/xdg-open | 1+
Atpl/make-test | 8++++++++
8 files changed, 22 insertions(+), 8 deletions(-)

diff --git a/bin/epih b/bin/epih @@ -1,10 +1,10 @@ #!/bin/sh -cat <<EOF > "$1" +cat << EOF /* ** EPITECH PROJECT, 2017 -** ${1%.*} +** $(basename "$(dirname "$(git rev-parse --absolute-git-dir)")") ** File description: -** ${1%.*} +** Copyright $(date +%Y) (c) Josuah Demangeon. All rights reserved. */ EOF diff --git a/bin/git-status b/bin/git-status @@ -1,6 +1,6 @@ -#!/bin/sh +#!/bin/sh -e -git rev-parse 2> /dev/null || exit 1 +git rev-parse 2> /dev/null git status --porcelain -b | awk ' /^## / { diff --git a/bin/log b/bin/log @@ -1,5 +1,5 @@ #!/bin/sh -[ "$#" -ge 1 ] || exec ls "$CFG/run" +[ "$#" -ge 1 ] || exec ls -R "$VAR/log/$1" exec less "$VAR/log/$1" diff --git a/bin/qemu b/bin/qemu @@ -28,7 +28,7 @@ case "$1" in -device e1000,netdev=net0 \ -netdev user,id=net0,hostfwd=tcp::$port-:22 \ -display none \ - "$VAR/qemu/$2" \ + "$VAR/qemu/$2" \ 1>> "$LOG/qemu/$2" & ;; (*) diff --git a/bin/ssh-paste b/bin/ssh-paste @@ -2,7 +2,7 @@ cat "$@" | ssh josuah@josuah.net ' set -e - cd srv/p && tmp=$(mktemp XXXXX.txt) + cd srv/p && tmp=$(mktemp XXXXX) cat > "$tmp" printf %s "$tmp" ' | sed 's|.*|gopher://josuah.net/0/p/&|' diff --git a/bin/tpl b/bin/tpl @@ -0,0 +1,5 @@ +#!/bin/sh + +[ "$#" -ge 1 ] || exec ls -R "$CFG/tpl" + +exec cat "$CFG/tpl/$1" diff --git a/bin/xdg-open b/bin/xdg-open @@ -209,6 +209,7 @@ esac do ffplay "$song" done + exit ;; #--- pager --------------------------------------------------------------------- (*.[0-9]|*.[0-9]p|*.[0-9].gz) diff --git a/tpl/make-test b/tpl/make-test @@ -0,0 +1,8 @@ + +test: ${TEST:.c=} +${TEST:.c=}: ${TEST:.c=.o} ${OBJ} + @printf '\n' + g++ ${OBJ} -o $@ $@.o ${LDFLAGS} + -@if [ -f $@.ref ]; then $@ | diff - $@.ref; else $@; fi && \ + printf '[\033[1;32m OK \033[m]\n' || \ + printf '[\033[1;31mFAIL\033[m]\n'