diff options
author | Roman Grundkiewicz <rgrundki@exseed.ed.ac.uk> | 2018-07-31 21:17:14 +0300 |
---|---|---|
committer | Roman Grundkiewicz <rgrundki@exseed.ed.ac.uk> | 2018-07-31 21:17:14 +0300 |
commit | e3f8f6a9819aadb0e1deae47b0dcae2846d71395 (patch) | |
tree | ae69ff34f068a0937b53553812d0c0ba5473bf13 /contrib | |
parent | 9557b2b82e8bd1de8a5030229425b74824b188e8 (diff) |
Install clang-format if not installed
Diffstat (limited to 'contrib')
-rwxr-xr-x | contrib/autoformat.sh | 8 |
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 |