summaryrefslogtreecommitdiff
path: root/examples/caretaker-shell
blob: ce59a90f0ffe8e84be8f5103f959d789ffd3749b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/bin/env zsh

# Change this to your package root
PKG_ROOT='/home/derf/var/packages_root'

# Change this to the location of your pkglist script (if non-default)
PKG_LIST=${PKG_ROOT}/pkglist

args=(${(z)SSH_ORIGINAL_COMMAND})

if [[ \
	( \
		$args[1] == ${PKG_LIST} && \
		$args[2] == ${PKG_ROOT} \
	) || ( \
		$args[1] == 'git-'(upload|receive)'-pack' && \
		$args[2] != *'../'* && \
		$args[2] == \'${PKG_ROOT}/*\' \
	) \
]] {
	args[2]=${args[2]//\'}
	${args}
}