forked from rgcr/m-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathm
executable file
·54 lines (35 loc) · 887 Bytes
/
m
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/bin/sh
pushd `dirname $0` > /dev/null
MPATH=`pwd -P`
popd > /dev/null
. ${MPATH}/lib/colors.sh
. ${MPATH}/lib/functions.sh
usage(){
cat <<__EOF__
Swiss Army Knife for Mac OS X !
usage: m [OPTIONS] COMMAND [help]
OPTIONS
--update update m-cli to the latest version
--uninstall uninstall m-cli
COMMANDS:
help
__EOF__
for i in ${MPATH}/plugins/*; do
[ ! -L "$i" -a -f "$i" ] && echo " ${i##*/}"
done
exit 1
}
case $1 in
--update)
${MPATH}/install.sh
exit 0
;;
--uninstall)
confirm "Do you want to uninstall m-cli? [y/n]: " && rm -rf ${MPATH} 2>/dev/null && echo "Done !"
exit 0
;;
esac
COMMAND=$1; shift;
[ ! -f ${MPATH}/plugins/${COMMAND} ] && usage
${MPATH}/plugins/${COMMAND} $@
# vim: set ts=4 sw=4 softtabstop=4 expandtab