tianyun 2 년 전
부모
커밋
f6c9bf29ad
1개의 변경된 파일10개의 추가작업 그리고 0개의 파일을 삭제
  1. 10 0
      sh/git_cp_file.sh

+ 10 - 0
sh/git_cp_file.sh

@@ -4,10 +4,20 @@
 dev_branch=$(git branch --show-current)
 test_branch=$1
 grep_pattern=$2
+show_diff=$3
 
 # 使用git diff命令查找test分支相对于dev分支修改的文件名,然后使用grep过滤文件名
 files=$(git diff --name-only ${dev_branch}..${test_branch} | egrep ${grep_pattern})
 
+echo "找到文件:"${files}
+
+read -p "请输入 y 继续执行脚本:" input
+
+if [ ! "${input}" = "y" ]; then
+    echo "退出脚本"
+    exit 1
+fi
+
 # 使用for循环遍历文件名列表
 for file in $files; do
   # 判断文件是否存在