You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
#!/bin/bash
|
|
|
|
#
|
|
|
|
# Main entry script for dotbare, used to route command to appropriate scripts
|
|
|
|
#
|
|
|
|
# @params
|
|
|
|
# Globals
|
|
|
|
# ${action_command}: string, determine which script to call
|
|
|
|
# Arguments
|
|
|
|
# None
|
|
|
|
|
|
|
|
mydir="${0%/*}"
|
|
|
|
|
|
|
|
function usage() {
|
|
|
|
echo "help"
|
|
|
|
}
|
|
|
|
|
|
|
|
# if no argument passed in, let git display help message
|
|
|
|
if [[ -z "$@" ]]; then
|
|
|
|
/usr/bin/git --git-dir=$HOME/.cfg/ --work-tree=$HOME
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
action_command=''
|
|
|
|
case "$1" in
|
|
|
|
fadd)
|
|
|
|
action_command='fadd'
|
|
|
|
shift
|
|
|
|
;;
|
|
|
|
frm)
|
|
|
|
action_command='frm'
|
|
|
|
shift
|
|
|
|
;;
|
|
|
|
fpop)
|
|
|
|
action_command='fpop'
|
|
|
|
shift
|
|
|
|
;;
|
|
|
|
help)
|
|
|
|
usage
|
|
|
|
exit 0
|
|
|
|
;;
|
|
|
|
-h)
|
|
|
|
usage
|
|
|
|
exit 0
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
if [[ -z "${action_command}" ]]; then
|
|
|
|
/usr/bin/git --git-dir=$HOME/.cfg/ --work-tree=$HOME "$@"
|
|
|
|
else
|
|
|
|
# run the scripts
|
|
|
|
"${mydir}/scripts/${action_command}" "$@"
|
|
|
|
fi
|