From b9a1b60555bb486be29429a0497f19f4ab94368e Mon Sep 17 00:00:00 2001 From: kay kurokawa Date: Mon, 9 Jul 2018 12:52:23 -0400 Subject: [PATCH] install clang-format for osx, do not add remote origin2 if it already exists for clang formatting check in reproducible_build.sh --- reproducible_build.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/reproducible_build.sh b/reproducible_build.sh index 573738731..6fecae3a4 100755 --- a/reproducible_build.sh +++ b/reproducible_build.sh @@ -215,6 +215,10 @@ function install_brew_packages() { brew_if_not_installed pkg-config brew_if_not_installed protobuf brew_if_not_installed gmp + + if [ "${CHECK_CODE_FORMAT}" = true ]; then + brew_if_not_installed clang-format + fi } function install_apt_packages() { @@ -371,7 +375,9 @@ function build_lbrycrd() { function clang_format_diff(){ # run a code formatting check on any commits not in master # requires clang-format - git remote add origin2 https://github.com/lbryio/lbrycrd.git + if ! git config remote.origin2.url > /dev/null; then + git remote add origin2 https://github.com/lbryio/lbrycrd.git + fi git fetch origin2 git diff -U0 origin2/master -- '*.h' '*.cpp' | ./contrib/devtools/clang-format-diff.py -p1 }