利用shell内建的type命令来判断一个命令行是否存在
hasCommandByType(){
if type $1 2>/dev/null;
then
return 1
else
return 0
fi
}
hasCommandByType quickgame
returnVue=$?
echo $returnVue
if [ $returnVue == 0 ] ;
then
echo "尚未安装oppo quickgame工具,跳过OPPO小游戏生成流程"
exit 0
fi
网友评论