-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsvn_neol
executable file
·40 lines (36 loc) · 1012 Bytes
/
svn_neol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/sh
#
# svn_neol - SVN Native EOL Script
#
# Adds an svn property svn:eol-style to all files ending in the supplied extesion
#
# Usage:
# svn_neol [file_extension]
#
# Example:
# svn_neol php
# php files under the working directory will be checkout-out next time w/
# native line-endings.
#
# @date November 22, 2010
# @author Sonny Gauran <[email protected]>
if [ $# = 0 ]; then
echo "Error: File extension expected\n"
echo "SVN Native EOL Script"
echo "Usage: svn_neol [file_extension]"
exit 1;
fi
if [ $# = 1 ]; then
# Checks if the current directory is an SVN Repository
if [ $( svn info | grep -c "^Path") = 0 ]; then
echo "The current directory is not an SVN working copy"
exit 2
else
# Recursively work on the files described by $1 (file_extension)
for file in $(find * -true | grep "\.$1\$"); do
svn propset svn:eol-style native ${file}
done
echo "Done."
fi
fi
exit 0