diff options
author | Antoine ELIAS <antoine.elias@scilab-enterprises.com> | 2016-11-13 12:04:44 +0100 |
---|---|---|
committer | Antoine ELIAS <antoine.elias@scilab-enterprises.com> | 2016-11-13 14:03:36 +0100 |
commit | ba0902ab6a77ca532086b5b4f27d67489be4b814 (patch) | |
tree | 3bdaf3c398f4f32dffb1fc14e017f8a98bd0a729 /git_hooks/pre-commit | |
parent | a7015d45ff3ac2f10c1564d14fb0f6669478a806 (diff) | |
parent | a53c2c4f46b1ea42d908b751310cb6bd92b7a870 (diff) | |
download | scilab-windows.zip scilab-windows.tar.gz |
Merge remote-tracking branch 'origin/master' into windowswindows
Change-Id: I80edbceb67381ca1af2b19ef82ee08fc5b385909
Diffstat (limited to 'git_hooks/pre-commit')
-rwxr-xr-x | git_hooks/pre-commit | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/git_hooks/pre-commit b/git_hooks/pre-commit index 6ffc063..3de975b 100755 --- a/git_hooks/pre-commit +++ b/git_hooks/pre-commit | |||
@@ -19,7 +19,10 @@ fi | |||
19 | # | 19 | # |
20 | # Configuration check | 20 | # Configuration check |
21 | # | 21 | # |
22 | XMLINDENT="$(git config --get hooks.xmlindent)" | 22 | if test ! -x "$XMLINDENT" |
23 | then | ||
24 | XMLINDENT="$(git config --get hooks.xmlindent)" | ||
25 | fi | ||
23 | if test ! -x "$XMLINDENT" | 26 | if test ! -x "$XMLINDENT" |
24 | then | 27 | then |
25 | echo "Unable to find xmlindent executable on the configuration." | 28 | echo "Unable to find xmlindent executable on the configuration." |
@@ -45,7 +48,10 @@ else | |||
45 | XMLINDENT_IGNORED="$(find $(git config --get-all xmlindent.ignored))" | 48 | XMLINDENT_IGNORED="$(find $(git config --get-all xmlindent.ignored))" |
46 | fi | 49 | fi |
47 | 50 | ||
48 | ASTYLE="$(git config --get hooks.astyle)" | 51 | if test ! -x "$ASTYLE" |
52 | then | ||
53 | ASTYLE="$(git config --get hooks.astyle)" | ||
54 | fi | ||
49 | if test ! -x "$ASTYLE" | 55 | if test ! -x "$ASTYLE" |
50 | then | 56 | then |
51 | echo "Unable to find astyle executable on the configuration." | 57 | echo "Unable to find astyle executable on the configuration." |
@@ -128,6 +134,9 @@ __indent_xml() { | |||
128 | 134 | ||
129 | echo "Formatting" "$FILES" | 135 | echo "Formatting" "$FILES" |
130 | "$XMLINDENT" -w -i 4 $FILES || return 2; | 136 | "$XMLINDENT" -w -i 4 $FILES || return 2; |
137 | # xmlindent does not remove trailing whitespaces | ||
138 | # and might add some on empty lines | ||
139 | sed -i -e 's/[ \t]*$//' $FILES || return 2; | ||
131 | git add $FILES || return 3; | 140 | git add $FILES || return 3; |
132 | } | 141 | } |
133 | 142 | ||