<commit_before>#!/bin/bash
# Installation script for GitHub for cPanel plugin.
# Will first check dependancies and install

# Git
command -v git >/dev/null 2>&1
GIT_IS_INSTALLED=$?
if [[ $GIT_IS_INSTALLED -ne 0 ]]; then
    echo >&2 "Git is not installed. Installing..";
    yum install git
fi

#Composer
composer -v > /dev/null 2>&1
COMPOSER_IS_INSTALLED=$?
if [[ $COMPOSER_IS_INSTALLED -ne 0 ]]; then
    echo "Composer is not installed. Installing..."
    # Install Composer
    curl -sS https://getcomposer.org/installer | php
    sudo mv composer.phar /usr/local/bin/composer
else
    echo "Composer is installed. Running update..."
    sudo composer self-update
fi

# Move to cPanel plugin folder
mkdir /usr/local/cpanel/base/frontend/paper_lantern/github_for_cpanel
cd /usr/local/cpanel/base/frontend/paper_lantern/github_for_cpanel

# Download the plugin archive
wget -q https://github.com/mbitson/github-for-cpanel/blob/master/build/ghcp-release.tar.gz?raw=true -O github_for_cpanel.tar.gz

# Extract archive
tar -zxvf github_for_cpanel.tar.gz &&

# Register plugin with cPanel
/usr/local/cpanel/scripts/install_plugin /usr/local/cpanel/base/frontend/paper_lantern/github_for_cpanel --theme paper_lantern

#Cleanup by removing release
rm -f /usr/local/cpanel/base/frontend/paper_lantern/github_for_cpanel/github_for_cpanel.tar.gz

# TODO - Run composer update once plugin is installed.<commit_msg>Added composer update to install, fixed typo.<commit_after>#!/bin/bash
# Installation script for GitHub for cPanel plugin.
# Will first check dependancies and install

# Git
command -v git >/dev/null 2>&1
GIT_IS_INSTALLED=$?
if [[ $GIT_IS_INSTALLED -ne 0 ]]; then
    echo >&2 "Git is not installed. Installing..";
    yum install git
fi

#Composer
composer -v > /dev/null 2>&1
COMPOSER_IS_INSTALLED=$?
if [[ $COMPOSER_IS_INSTALLED -ne 0 ]]; then
    echo "Composer is not installed. Installing..."
    # Install Composer
    curl -sS https://getcomposer.org/installer | php
    sudo mv composer.phar /usr/local/bin/composer
else
    echo "Composer is installed. Running update..."
    sudo composer self-update
fi

# Move to cPanel plugin folder
mkdir /usr/local/cpanel/base/frontend/paper_lantern/github_for_cpanel
cd /usr/local/cpanel/base/frontend/paper_lantern/github_for_cpanel

# Download the plugin archive
wget -q https://github.com/mbitson/github-for-cpanel/blob/master/build/ghcp-release.tar.gz?raw=true -O github_for_cpanel.tar.gz

# Extract archive
tar -zxvf github_for_cpanel.tar.gz

# Register plugin with cPanel
/usr/local/cpanel/scripts/install_plugin /usr/local/cpanel/base/frontend/paper_lantern/github_for_cpanel --theme paper_lantern

#Cleanup by removing release
rm -f github_for_cpanel.tar.gz

# TODO - Run composer update once plugin is installed.
composer.phar update
{'fraction_non_alphanumeric': 0.10543245175125089, 'fraction_numerical': 0.005003573981415297, 'mean_word_length': 4.126373626373627, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3977483', 'n_tokens_mistral': 990, 'n_tokens_neox': 950, 'n_words': 249}