3 Star 0 Fork 0

Gitee 极速下载 / m-cli

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/rgcr/m-cli
克隆/下载
m 1.25 KB
一键复制 编辑 Web IDE 原始数据 按行查看 历史
#!/usr/bin/env bash
[ -L $0 ] && pushd `readlink $0 | xargs dirname` > /dev/null \
|| pushd `dirname $0` > /dev/null
export MPATH=`pwd -P`
popd > /dev/null
confirm () {
read -r -p "${1:-Are you sure? [y/N]} " response
case $response in
[yY][eE][sS]|[yY])
true
;;
*)
false
;;
esac
}
update_mcli(){
INSTALL_DIR=${MPATH} ${MPATH}/install.sh
}
uninstall_mcli(){
confirm "Do you want to uninstall m-cli? [y/n]: " \
&& sudo rm -rf ${MPATH} 2>/dev/null \
&& sudo rm -f "/usr/local/bin/m" 2>/dev/null \
&& echo "Done !"
}
usage(){
cat <<__EOF__
 Swiss Army Knife for macOS ! 
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
[ "${COMMAND}" == "help" ] && exit 0 || exit 1
}
case $1 in
--update)
update_mcli && exit 0
;;
--uninstall)
uninstall_mcli && exit 0
;;
esac
COMMAND=$1; shift;
[ ! -f ${MPATH}/plugins/${COMMAND} ] && usage
${MPATH}/plugins/${COMMAND} "$@"
Objective-C
1
https://gitee.com/mirrors/m-cli.git
git@gitee.com:mirrors/m-cli.git
mirrors
m-cli
m-cli
master

搜索帮助

14c37bed 8189591 565d56ea 8189591