add callables

This commit is contained in:
Gitea 2022-04-02 09:15:10 +00:00
parent ecee849c6e
commit 99e2c68589
5 changed files with 50 additions and 0 deletions

6
delrepo Executable file
View file

@ -0,0 +1,6 @@
#!/bin/sh
TRASH_DIR=trash
basename=$(basename $1)
mv $1 ${TRASH_DIR}/${basename}

10
desc Executable file
View file

@ -0,0 +1,10 @@
#!/bin/sh
if [ "$#" -eq 1 ] ; then
cat "$1/description"
elif [ "$#" -eq 2 ] ; then
echo $2 > "$1/description"
else
echo "usage: ${0} <repo path> [<description>]"
fi

18
help Executable file
View file

@ -0,0 +1,18 @@
#!/bin/sh
if tty -s
then
echo "Run 'help' for help, or 'exit' to leave. Available commands:"
else
echo "Run 'help' for help. Available commands:"
fi
cd "$(dirname "$0")"
for cmd in *
do
case "$cmd" in
help) ;;
*) [ -f "$cmd" ] && [ -x "$cmd" ] && echo "$cmd" ;;
esac
done

12
list Executable file
View file

@ -0,0 +1,12 @@
#!/bin/sh
TRASH_DIR='trash'
print_if_bare_repo='
if "$(git --git-dir="$1" rev-parse --is-bare-repository)" = true
then
printf "%s\n %s\n\n" "${1#./}" "$(cat ${1}/description)"
fi
'
find -type d -name "*.git" -not -path "./${TRASH_DIR}/*" -exec sh -c "$print_if_bare_repo" -- \{} \; -prune 2>/dev/null

4
newrepo Executable file
View file

@ -0,0 +1,4 @@
#!/bin/sh
mkdir -p ~/$1
cd ~/$1
git init --bare