commit 198c5664dedb07351710aaf7712b2e1d39bbd9d7
parent 258adea4e8a1ad7e0f3942f881ab30ec43f3869e
Author: Oscar Benedito <oscar@oscarbenedito.com>
Date:   Fri, 30 Oct 2020 21:55:54 +0100

Add command: category

Diffstat:
Acategory | 13+++++++++++++
1 file changed, 13 insertions(+), 0 deletions(-)

diff --git a/category b/category @@ -0,0 +1,13 @@ +#!/bin/sh + +# Check number of params +[ $# -ne 1 ] && [ $# -ne 2 ] && \ + echo "Usage: category <project.git> <category>" && exit 1 + +# Set the project name, adding .git if necessary +p=$(echo "$1" | sed 's/\.git$\|$/.git/i') + +[ ! -d "$p" ] && echo "$p not found." + +[ -n "$2" ] && echo "$2" > "$p/category" \ + || rm -f "$p/category"