From e478aacabd69d86a70f34ffa1887fc0adeba2d87 Mon Sep 17 00:00:00 2001 From: Chuck Atkins <chuck.atkins@kitware.com> Date: Tue, 6 Dec 2016 20:46:45 -0500 Subject: [PATCH] Fix aliases and hooks --- scripts/developer/git/setup-aliases | 4 ++-- scripts/developer/setup.sh | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) mode change 100644 => 100755 scripts/developer/setup.sh diff --git a/scripts/developer/git/setup-aliases b/scripts/developer/git/setup-aliases index 11b43d53f..5479ad0dd 100755 --- a/scripts/developer/git/setup-aliases +++ b/scripts/developer/git/setup-aliases @@ -1,13 +1,13 @@ #!/usr/bin/env bash +echo "Setting up git aliases..." if ! which clang-format 2>1 1>/dev/null then echo "ADIOS development requires clang-format to be available in your path." exit 1 fi -echo "Adding 'git clang-format' alias" -if ! git config alias.clang-format "!bash scripts/git/git-clang-format" +if ! git config alias.clang-format "!scripts/developer/git/git-clang-format" then echo "Error adding clang-format alias" exit 2 diff --git a/scripts/developer/setup.sh b/scripts/developer/setup.sh old mode 100644 new mode 100755 index bd3bed7ae..082cb1257 --- a/scripts/developer/setup.sh +++ b/scripts/developer/setup.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -test_cmd { +function test_cmd { if ! $1 ; then echo "Error: $2"; @@ -8,11 +8,11 @@ test_cmd { fi } -cd "${BASH_SOURCE%/*}" +cd "${BASH_SOURCE%/*}/../.." -test_cmd scripts/git/setup-alias \ +test_cmd scripts/developer/git/setup-aliases \ "Failed to setup git aliases" 2 -test_cmd scripts/git/setup-hooks \ +test_cmd scripts/developer/git/setup-hooks \ "Failed to setup git hooks" 1 git config hooks.clang-format true -- GitLab