<commit_before>#!/bin/bash -e

function installDependencies()
{
    if [[ "$(existCommand 'brew')" = 'false' ]]
    then
        "${APP_FOLDER_PATH}/../../brew/recipes/install.bash"
    fi
}

function install()
{
    su -l "${SUDO_USER}" -c "${SHELL_CHECK_BREW_INSTALL_FOLDER}/bin/brew install shellcheck"

    if [[ "${SHELL_CHECK_BREW_INSTALL_FOLDER}" != '/usr/local' ]]
    then
        ln -f -s "${SHELL_CHECK_BREW_INSTALL_FOLDER}/bin/shellcheck" '/usr/local/bin/shellcheck'
    fi

    displayVersion "$(shellcheck -V)"
}

function main()
{
    APP_FOLDER_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"

    source "${APP_FOLDER_PATH}/../../../libraries/util.bash"
    source "${APP_FOLDER_PATH}/../attributes/default.bash"

    checkRequireMacSystem
    checkRequireRootUser

    header 'INSTALLING SHELL-CHECK'

    # Install

    installDependencies
    install
    installCleanUp
}

main "${@}"<commit_msg>bug fixes<commit_after>#!/bin/bash -e

function installDependencies()
{
    if [[ "$(existCommand 'brew')" = 'false' ]]
    then
        "${APP_FOLDER_PATH}/../../brew/recipes/install.bash"
    fi
}

function install()
{
    initializeFolder "$(getCurrentUserHomeFolder)/Library/Caches/Homebrew"

    su -l "${SUDO_USER}" -c "${SHELL_CHECK_BREW_INSTALL_FOLDER}/bin/brew install shellcheck"

    if [[ "${SHELL_CHECK_BREW_INSTALL_FOLDER}" != '/usr/local' ]]
    then
        ln -f -s "${SHELL_CHECK_BREW_INSTALL_FOLDER}/bin/shellcheck" '/usr/local/bin/shellcheck'
    fi

    displayVersion "$(shellcheck -V)"
}

function main()
{
    APP_FOLDER_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"

    source "${APP_FOLDER_PATH}/../../../libraries/util.bash"
    source "${APP_FOLDER_PATH}/../attributes/default.bash"

    checkRequireMacSystem
    checkRequireRootUser

    header 'INSTALLING SHELL-CHECK'

    # Install

    installDependencies
    install
    installCleanUp
}

main "${@}"
{'fraction_non_alphanumeric': 0.16823406478578892, 'fraction_numerical': 0.0010449320794148381, 'mean_word_length': 3.372146118721461, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4927654', 'n_tokens_mistral': 713, 'n_tokens_neox': 656, 'n_words': 109}