From: Oleg Broytman Date: Thu, 20 Mar 2025 08:37:03 +0000 (+0300) Subject: Add script `init` X-Git-Url: https://git.phdru.name/?a=commitdiff_plain;h=e2a759b7ba009f6d095524b64634eb47aa87b206;p=git-scripts.git Add script `init` The primary goal is to automatically add the new repository to `locate-all.list`. --- diff --git a/init b/init new file mode 100755 index 0000000..849ba89 --- /dev/null +++ b/init @@ -0,0 +1,17 @@ +#! /bin/sh + +if [ -n "$2" ]; then + echo "Usage: $0 [subdir]" >&2 + exit 1 +fi + +set -e +subdir="$1" + +if [ -n "$subdir" ]; then + mkdir -p "$subdir" + cd "$subdir" +fi + +git init +pwd >> "`dirname \"$0\"`"/locate-all.list