Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/marian-nmt/marian.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoman Grundkiewicz <rgrundki@exseed.ed.ac.uk>2018-07-31 21:17:14 +0300
committerRoman Grundkiewicz <rgrundki@exseed.ed.ac.uk>2018-07-31 21:17:14 +0300
commite3f8f6a9819aadb0e1deae47b0dcae2846d71395 (patch)
treeae69ff34f068a0937b53553812d0c0ba5473bf13 /contrib
parent9557b2b82e8bd1de8a5030229425b74824b188e8 (diff)
Install clang-format if not installed
Diffstat (limited to 'contrib')
-rwxr-xr-xcontrib/autoformat.sh8
1 files changed, 7 insertions, 1 deletions
diff --git a/contrib/autoformat.sh b/contrib/autoformat.sh
index 3be6c485..18a5dbac 100755
--- a/contrib/autoformat.sh
+++ b/contrib/autoformat.sh
@@ -1,3 +1,9 @@
-#!/bin/bash
+#!/bin/bash -v
+
+if ! [ -x "$( command -v clang-format )" ]
+then
+ mkdir -p $HOME/.local
+ wget -O- http://releases.llvm.org/6.0.0/clang+llvm-6.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz | tar --xz -xf - -C $HOME/.local --strip 1
+fi
find ./src \( -path ./src/3rd_party -o -path ./src/tests -o -path ./src/models/experimental \) -prune -o -iname *.h -o -iname *.cpp -o -iname *.cu | xargs clang-format -i