blob: ea05932230fd32e1429a33d96edaef110a21af0b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
#!/bin/sh
while getopts clsmM opt; do
case $opt in
c) dir="$HOME"
cmd="git --git-dir=$dir/.cfg$opt/ --work-tree=$dir"
meta_file="$XDG_CONFIG_HOME/myconf/cfg${opt}_meta";;
l|s) dir=/
cmd="sudo git --git-dir=/etc/.cfg$opt/ --work-tree=/"
meta_file="/etc/myconf/cfg${opt}_meta";;
m) sudo gitmetap "$cmd" "$dir" "$meta_file"
exit;;
M) sudo gitmetar "$meta_file"
exit;;
\?) exit 1;;
esac
done
shift $((OPTIND-1))
$cmd "$@"
|