forked from scalatest/scalatest
-
Notifications
You must be signed in to change notification settings - Fork 0
/
use-ldquo-and-rdquo.bash
executable file
·96 lines (90 loc) · 2.86 KB
/
use-ldquo-and-rdquo.bash
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#!/bin/bash
# 2013-0906 Darlene Wallach script to replace Microsoft left (“) and
# right (”) double quote marks with nicer style
# “ and ” in all scaladoc files for
# ScalaTest
echo `pwd`
# getting all the scala files in the src directories
for file in `find ./src -type f | grep '\.scala'`
do
# find the scala files with a Microsoft style left double quote “
grep "“" ${file} > /dev/null
if [ $? == 0 ]
then
# use sed to edit the file in place
# replace Microsoft style left double quote with “
sed -i -e "s/\“/\“/" ${file}
fi
# while we still have the file,
# check for Microsoft style right double quote
grep "”" ${file} > /dev/null
if [ $? == 0 ]
then
# use sed to edit the file in place
# replace Microsoft style right double quote with ”
sed -i -e "s/\”/\”/" ${file}
fi
done
# getting all the java files in the src directories
for file in `find ./src/ -type f | grep '\.java'`
do
# find the java files with a Microsoft style left double quote “
grep "“" ${file} > /dev/null
if [ $? == 0 ]
then
# use sed to edit the file in place
# replace Microsoft style left double quote with “
sed -i -e "s/\“/\“/" ${file}
fi
# while we still have the file,
# check for Microsoft style right double quote
grep "”" ${file} > /dev/null
if [ $? == 0 ]
then
# use sed to edit the file in place
# replace Microsoft style right double quote with ”
sed -i -e "s/\”/\”/" ${file}
fi
done
# getting all the scala files in the examples directories
for file in `find ./examples/src/ -type f | grep '\.scala'`
do
# find the scala files with a Microsoft style left double quote “
grep "“" ${file} > /dev/null
if [ $? == 0 ]
then
# use sed to edit the file in place
# replace Microsoft style left double quote with “
sed -i -e "s/\“/\“/" ${file}
fi
# while we still have the file,
# check for Microsoft style right double quote
grep "”" ${file} > /dev/null
if [ $? == 0 ]
then
# use sed to edit the file in place
# replace Microsoft style right double quote with ”
sed -i -e "s/\”/\”/" ${file}
fi
done
# getting all the java files in the examples directories
for file in `find ./examples/src/ -type f | grep '\.java'`
do
# find the java files with a Microsoft style left double quote “
grep "“" ${file} > /dev/null
if [ $? == 0 ]
then
# use sed to edit the file in place
# replace Microsoft style left double quote with “
sed -i -e "s/\“/\“/" ${file}
fi
# while we still have the file,
# check for Microsoft style right double quote
grep "”" ${file} > /dev/null
if [ $? == 0 ]
then
# use sed to edit the file in place
# replace Microsoft style right double quote with ”
sed -i -e "s/\”/\”/" ${file}
fi
done