#!/usr/bin/env fish
# echo check for permissions
set -l USER (whoami)
set matcher (string match -r -g "^.*'(.*)'\$" "$argv")
cat /srv/repos/permissions | grep -q -E "^$matcher[1]:$USER"
or exit 1;
# run command
/usr/bin/sudo -u git /usr/bin/git-shell -c "$argv"