mirror of
https://github.com/ossrs/srs.git
synced 2025-02-13 11:51:57 +00:00
add git2unix script
This commit is contained in:
parent
e76c53dae8
commit
8766ab5de2
2 changed files with 22 additions and 0 deletions
|
@ -1,5 +1,7 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
# sudo ln -sf `pwd`/git.commit.sh /bin/git-ensure-commit
|
||||||
|
|
||||||
echo "submit code to github.com"
|
echo "submit code to github.com"
|
||||||
|
|
||||||
echo "argv[0]=$0"
|
echo "argv[0]=$0"
|
||||||
|
|
20
trunk/scripts/git2unix.sh
Executable file
20
trunk/scripts/git2unix.sh
Executable file
|
@ -0,0 +1,20 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# sudo ln -sf `pwd`/git2unix.sh /bin/git2unix
|
||||||
|
|
||||||
|
dos2unix -V>/dev/null 2>&1
|
||||||
|
ret=$?; if [[ 0 -ne $ret ]]; then
|
||||||
|
echo "dos2unix not found."
|
||||||
|
echo " sudo yum install -y dos2unix"
|
||||||
|
exit $ret
|
||||||
|
fi
|
||||||
|
|
||||||
|
files=`git status|egrep "(modified|new file)"|awk -F ':' '{print $2}'|awk '{print $1}'|egrep "(.hpp$|.cpp$|.cc$|.h$|.c$|.txt$|.sh$)"`;
|
||||||
|
for file in $files; do
|
||||||
|
dos2unix $file;
|
||||||
|
echo $file|grep ".sh$" >/dev/null 2>&1; EOF_SH=$?
|
||||||
|
if [[ $EOF_SH -ne 0 && -f $file ]]; then
|
||||||
|
echo "chmod -x $file"
|
||||||
|
chmod -x $file;
|
||||||
|
fi
|
||||||
|
done
|
Loading…
Reference in a new issue