On Fri, Jan 29, 2021 at 05:14:02PM +0800, Liu Yinsi wrote:
# It's better to run the below scripts step by step.
+export server=$1 +export action=$2
+server_skip() +{
- local deploy_script=$1
- [ "$server" != "server" ] && ${deploy_script}
+}
[[ $CCI_SRC ]] || export CCI_SRC=$(cd $(dirname $(realpath $0)); git rev-parse --show-toplevel) cd $CCI_SRC/sparrow || exit
-0-package/install +server_skip 0-package/install
The better style is to make server_skip a test function, and call it this way
directly use like this? [ $1 != 'server'] && 0-package/install
Yes.
Even better, can we split this script into two smaller ones?
我应该根据什么来拆分呢, 把需要网络的放一块,不需要的放在一个脚本里面吗?
把加了server_skip的这些行抽离出去变成一个新脚本?
Thanks, Fengguang