正在显示
2 个修改的文件
包含
22 行增加
和
0 行删除
trunk/scripts/git2unix.sh
0 → 100755
1 | +#!/bin/bash | ||
2 | + | ||
3 | +# sudo ln -sf `pwd`/git2unix.sh /bin/git2unix | ||
4 | + | ||
5 | +dos2unix -V>/dev/null 2>&1 | ||
6 | +ret=$?; if [[ 0 -ne $ret ]]; then | ||
7 | + echo "dos2unix not found." | ||
8 | + echo " sudo yum install -y dos2unix" | ||
9 | + exit $ret | ||
10 | +fi | ||
11 | + | ||
12 | +files=`git status|egrep "(modified|new file)"|awk -F ':' '{print $2}'|awk '{print $1}'|egrep "(.hpp$|.cpp$|.cc$|.h$|.c$|.txt$|.sh$)"`; | ||
13 | +for file in $files; do | ||
14 | + dos2unix $file; | ||
15 | + echo $file|grep ".sh$" >/dev/null 2>&1; EOF_SH=$? | ||
16 | + if [[ $EOF_SH -ne 0 && -f $file ]]; then | ||
17 | + echo "chmod -x $file" | ||
18 | + chmod -x $file; | ||
19 | + fi | ||
20 | +done |
-
请 注册 或 登录 后发表评论