<commit_before>#!/bin/bash
# Purpose:
#	- bootstrap machine in order to prepare for ansible playbook run

set -e 

# Download and install Command Line Tools if no developer tools exist
#       * previous evaluation didn't work completely, due to gcc binary existing for vanilla os x install
#       * gcc output on vanilla osx box:
#       * 'xcode-select: note: no developer tools were found at '/Applications/Xcode.app', requesting install.
#       * Choose an option in the dialog to download the command line developer tools'
#
# Evaluate 2 conditions
#       * ensure dev tools are installed by checking the output of gcc
#       * check to see if gcc binary even exists ( original logic )
# if either of the conditions are met, install dev tools

if [[ $(/usr/bin/gcc 2>&1) =~ "no developer tools were found" ]] || [[ ! -x /usr/bin/gcc ]]; then
    echo "Info   | Install   | xcode"
    xcode-select --install
fi

# Download and install Homebrew
if [[ ! -x /usr/local/bin/brew ]]; then
    echo "Info   | Install   | homebrew"
    ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
fi

# Download and install Pip

if [[ ! -x /usr/local/bin/pip ]]; then
    echo "Info   | Install   | Pip"
    easy_install pip
fi


# Download and install Ansible
if [[ ! -x /usr/local/bin/ansible ]]; then
    echo "Info   | Install   | Ansible"
    pip install ansible
fi

# Modify the PATH
# This should be subsequently updated in shell settings
export PATH=/usr/local/bin:$PATH

ansible-playbook main.yml -i inventory -K<commit_msg>add download code to bootstrap<commit_after>#!/bin/bash
# Purpose:
#	- bootstrap machine in order to prepare for ansible playbook run

set -e 

# Download and install Command Line Tools if no developer tools exist
#       * previous evaluation didn't work completely, due to gcc binary existing for vanilla os x install
#       * gcc output on vanilla osx box:
#       * 'xcode-select: note: no developer tools were found at '/Applications/Xcode.app', requesting install.
#       * Choose an option in the dialog to download the command line developer tools'
#
# Evaluate 2 conditions
#       * ensure dev tools are installed by checking the output of gcc
#       * check to see if gcc binary even exists ( original logic )
# if either of the conditions are met, install dev tools

if [[ $(/usr/bin/gcc 2>&1) =~ "no developer tools were found" ]] || [[ ! -x /usr/bin/gcc ]]; then
    echo "Info   | Install   | xcode"
    xcode-select --install
fi

# Download and install Homebrew
if [[ ! -x /usr/local/bin/brew ]]; then
    echo "Info   | Install   | homebrew"
    ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
fi

# Download and install Pip

if [[ ! -x /usr/local/bin/pip ]]; then
    echo "Info   | Install   | Pip"
    easy_install pip
fi


# Download and install Ansible
if [[ ! -x /usr/local/bin/ansible ]]; then
    echo "Info   | Install   | Ansible"
    pip install ansible
fi


# Download and run ansible-playbook-mac-dev playbook

# 

rm -rf /tmp/ansible-playbook-mac-dev.zip
curl -o /tmp/ansible-playbook-mac-dev.zip https://github.com/bmacauley/ansible-playbook-mac-dev/archive/master.zip
unzip /tmp/ansible-playbook-mac-dev.zip




# Modify the PATH
# This should be subsequently updated in shell settings
export PATH=/usr/local/bin:$PATH

ansible-playbook /tmp/ansible-playbook-mac-dev/main.yml -i /tmp/ansible-playbook-mac-dev/inventory -K
{'fraction_non_alphanumeric': 0.1052784222737819, 'fraction_numerical': 0.0017401392111368909, 'mean_word_length': 3.091340450771056, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 3, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 12, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '560723', 'n_tokens_mistral': 1104, 'n_tokens_neox': 1036, 'n_words': 395}