blob: b851e211a7f746dfe8e1868028915e7e392ee1eb (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
#!/bin/sh
# Try to autodetect the tools dir
if [ "$BASH_SOURCE" != "" ]; then
TOOLS_PATH=`dirname ${BASH_SOURCE[0]}`
else
TOOLS_PATH=`pwd`/tools
fi
echo "Tools directory: $TOOLS_PATH"
# Install build tools if not installed yet
FILE=.buildtools
OS_NAME=`uname -a`
if [ ! -f $FILE ]; then
case "$OS_NAME" in
*Darwin*) tools/setup-buildtools-mac.sh ;;
*Linux*) [[ -z "$NOROOT" ]] && sudo $TOOLS_PATH/setup-buildtools.sh || echo "No root: skipping build tools installation." ;;
*) echo "WARNING: unsupported OS $OS_NAME , skipping build tools installation.."
esac
# Assume that the build tools have been successfully installed
echo > $FILE
else
echo Build tools have been already installed, skipping installation.
fi
# Configure git aliases for current session
export PATH=$TOOLS_PATH:$PATH
git config alias.cl '!git-cl.sh'
|