summaryrefslogtreecommitdiff
path: root/git
blob: 742bff15b91a05f2228b7a89218884a8343a7b4e (about) (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/bash
# Some git subcommands are made available to you.
# Use `select <repo>` first.



if [ $# -lt 1 ]; then
	echo "Usage: $0 <subcommand>..." >&2
	echo "Available subcommands:" >&2
	ls "$0.d" >&2
	exit 1
fi

subcmd="$1"
if [ ! -x "$0.d/$subcmd" ]; then
	echo "$0: error: unknown subcommand: $subcmd" >&2
	echo "Available subcommands:" >&2
	ls "$0.d" >&2
	exit 1
fi

export SELECTED_REPO="$(cat "$HOME/.selection" 2>/dev/null)"

shift

export PARENTCMD="$0"

exec "$0.d/$subcmd" "$@"