File tree 4 files changed +41
-17
lines changed
4 files changed +41
-17
lines changed Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
3
- if ! astyle.sh > /dev/null 2>&1 ; then
4
- echo astyle.sh not found in path >&2
5
- exit 1
6
- fi
3
+ PATH=$PATH :$( dirname $0 )
7
4
8
5
set -e
9
6
Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
3
- # if ! qgsloggermig.pl >/dev/null 2>&1; then
4
- # echo qgsloggermig.pl not found in path >&2
5
- # exit 1
6
- # fi
3
+ if ! type -p astyle > /dev/null; then
4
+ echo " astyle not found" >&2
5
+ exit 1
6
+ fi
7
+
8
+ if ! type -p flip > /dev/null; then
9
+ flip () {
10
+ :
11
+ }
12
+ fi
7
13
8
14
set -e
9
15
@@ -23,16 +29,19 @@ export ARTISTIC_STYLE_OPTIONS="\
23
29
--min-conditional-indent=-1 \
24
30
--suffix=none"
25
31
26
- # --break-blocks \
27
-
28
32
export ARTISTIC_STYLE_OPTIONS=" \
29
33
$ARTISTIC_STYLE_OPTIONS \
30
34
--pad=oper \
31
35
--pad=paren-in \
32
36
--unpad=paren"
33
37
34
38
for f in " $@ " ; do
35
- # flip -ub "$f"
36
- # qgsloggermig.pl "$f"
39
+ if ! [ -f " $f " ]; then
40
+ echo " $f not found" >&2
41
+ continue
42
+ fi
43
+
44
+ flip -ub " $f "
45
+ # qgsloggermig.pl "$f"
37
46
astyle $ARTISTIC_STYLE_OPTIONS " $f "
38
47
done
Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
3
- if ! [ -x astyle.sh ]; then
4
- PATH=$PATH :$( dirname $0 )
3
+ PATH=$PATH :$( dirname $0 )
4
+
5
+ if ! type -p astyle.sh > /dev/null; then
6
+ echo astyle.sh not found
7
+ exit 1
8
+ fi
9
+
10
+ if ! type -p colordiff > /dev/null; then
11
+ colordiff ()
12
+ {
13
+ cat " $@ "
14
+ }
5
15
fi
6
16
7
17
set -e
Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
3
- if ! [ -x astyle.sh ]; then
4
- PATH=$PATH :$( dirname $0 )
3
+ PATH=$PATH :$( dirname $0 )
4
+
5
+ if ! type -p colordiff > /dev/null; then
6
+ colordiff () {
7
+ cat " $@ "
8
+ }
5
9
fi
6
10
7
11
set -e
@@ -23,7 +27,6 @@ echo "Checking changes between $REV0 and $REV1"
23
27
ASTYLEDIFF=astyle.r$REV0 -r$REV1 .diff
24
28
> $ASTYLEDIFF
25
29
26
-
27
30
# reformat
28
31
for f in $MODIFIED ; do
29
32
case " $f " in
@@ -35,6 +38,11 @@ for f in $MODIFIED; do
35
38
;;
36
39
esac
37
40
41
+ if ! [ -s $f ]; then
42
+ # deleted
43
+ continue
44
+ fi
45
+
38
46
m=$f .r$REV1 .prepare
39
47
40
48
cp $f $m
You can’t perform that action at this time.
0 commit comments