#!/usr/bin/env bash #------------------------------------------------- # 公共开发工具 # @author yeahoo2000@gmail.com #------------------------------------------------- if [ "" == "$ROOT" ]; then echo -e "\e[91m>>\e[0;0m 此脚本必须通过tools/dev.sh调用才能正常工作" exit 1 fi # 生成配置文件模板 DOC[gen_cfg]="生成配置文件模板" fun_gen_cfg(){ local file=$ROOT/tools/cfg.ini if [ -f $file ]; then read -p " [93m=> 配置文件已经存在,是否生成新文件并覆盖它?[0;0m[y/n]" choice if [[ $choice != "y" ]]; then exit 0 fi fi cat > $file <[$t]" cd $dir find . -type f|xargs sed -i '' "s/$s/$t/g" } fun_git_diff(){ echo "git diff $2 $3" cd $1 && git diff $2 $3 }