#!/bin/sh main() { case "$1" in app) shift # 生产环境 [ -e $ctx_name ] || mkdir $ctx_name; cd $ctx_name export PS1='\\u@\\h[\\t]\\W\\$ ' PATH="$PWD/bin:$PWD/local/bin:$PWD/usr/local/go/bin:$PATH" prepare_ice && $PWD/bin/ice.bin forever start "$@" ;; dev) shift # 开发环境 require miss.sh; ish_miss_prepare_package; prepare_system; [ -f ~/.gitconfig ] || ish_dev_git_prepare if ! [ -e $ctx_name ]; then git config --global "url.$ctx_dev_ip/x/.insteadof" "${ctx_repos%/*}/" echo && ish_log_debug -g "clone $ctx_repos" && git clone $ctx_repos $ctx_name fi; cd $ctx_name source etc/miss.sh && $PWD/bin/ice.bin forever start "$@" ;; cmd) # 命令环境 ish_sys_dev_init >/dev/null; shift; [ -n "$*" ] && ish_sys_dev_run "$@" ;; *) echo "hello world" ;; esac } main "$@"