<commit_before>#! /usr/bin/env bash

main_loop() {
    download_runtime
    
    echo "Extracting tar.gz into $HOME/.local/share/dotnet/runtime/1.1.1..."
    mkdir -p $HOME/.local/share/dotnet/runtime/1.1.1 2> /dev/null

    if [ $? -eq 0 ]; then
        tar zxf /tmp/dotnet-runtime.tar.gz -C $HOME/.local/share/dotnet/runtime/1.1.1 2> /dev/null
    else
        echo "Install failed: Error making directory $HOME/.local/share/dotnet/runtime/1.1.1"
        exit 1
    fi

    if [ $? -eq 0 ]; then
        rm /tmp/dotnet-runtime.tar.gz;

        mkdir -p $HOME/.local/share/dotnet/bin
        ln -s $HOME/.local/share/dotnet/runtime/1.1.1/dotnet $HOME/.local/share/dotnet/bin/dotnet

        if ! [ -z $VERB ]; then echo "Setting $HOME/.local/share/dotnet/bin/dotnet as executable..."; fi
        chmod +x $HOME/.local/share/dotnet/runtime/1.1.1/dotnet
        chmod +x $HOME/.local/share/dotnet/bin/dotnet

        PATH_ADD='export PATH="$PATH:$HOME/.local/share/dotnet/bin"'

        if ! (grep -qF "$PATH_ADD" $HOME/.profile); then
            if ! [ -z $VERB ]; then echo "Adding $HOME/.local/share/dotnet/bin to user \$PATH..."; fi
            echo "# Added by .NET Core installer" >> "$HOME/.profile"
            echo $PATH_ADD >> "$HOME/.profile"
            echo >> "$HOME/.profile"
        else
            if ! [ -z $VERB ]; then echo "$HOME/.local/share/dotnet/bin already detected in ~/.profile, skip adding to \$PATH."; fi
        fi

        BASH_ADD='[[ ":$PATH:" != *":$HOME/.local/share/dotnet/bin:"* ]] && PATH="${PATH}:$HOME/.local/share/dotnet/bin"'
         
        if ! (grep -qF "$BASH_ADD" $HOME/.bashrc); then
            if ! [ -z $VERB ]; then echo "Adding $HOME/.local/share/dotnet/bin to user ~/.bashrc..."; fi
            echo "# Added by .NET Core installer" >> "$HOME/.bashrc"
            echo $BASH_ADD >> "$HOME/.bashrc"
            echo >> "$HOME/.bashrc"
        else
            if ! [ -z $VERB ]; then echo "$HOME/.local/share/dotnet/bin already detected in ~/.bashrc, skip adding to ~/.bashrc."; fi
        fi
        
        echo '.NET runtime installed successfully. You may need to log-out and back in or type ". ~/.profile" for the changes to take effect.'
        exit 0
    else
        echo "Install failed: Error encountered while extracting dotnet-runtime.tar.gz"
        exit 1
    fi
}

download_runtime() {
    case "$OS_ID" in
        "ubuntu")
            ubuntu_fetch
            return 0
            ;;<commit_msg>Add export for $BASH_ADD<commit_after>#! /usr/bin/env bash

main_loop() {
    download_runtime
    
    echo "Extracting tar.gz into $HOME/.local/share/dotnet/runtime/1.1.1..."
    mkdir -p $HOME/.local/share/dotnet/runtime/1.1.1 2> /dev/null

    if [ $? -eq 0 ]; then
        tar zxf /tmp/dotnet-runtime.tar.gz -C $HOME/.local/share/dotnet/runtime/1.1.1 2> /dev/null
    else
        echo "Install failed: Error making directory $HOME/.local/share/dotnet/runtime/1.1.1"
        exit 1
    fi

    if [ $? -eq 0 ]; then
        rm /tmp/dotnet-runtime.tar.gz;

        mkdir -p $HOME/.local/share/dotnet/bin
        ln -s $HOME/.local/share/dotnet/runtime/1.1.1/dotnet $HOME/.local/share/dotnet/bin/dotnet

        if ! [ -z $VERB ]; then echo "Setting $HOME/.local/share/dotnet/bin/dotnet as executable..."; fi
        chmod +x $HOME/.local/share/dotnet/runtime/1.1.1/dotnet
        chmod +x $HOME/.local/share/dotnet/bin/dotnet

        PATH_ADD='export PATH="$PATH:$HOME/.local/share/dotnet/bin"'

        if ! (grep -qF "$PATH_ADD" $HOME/.profile); then
            if ! [ -z $VERB ]; then echo "Adding $HOME/.local/share/dotnet/bin to user \$PATH..."; fi
            echo "# Added by .NET Core installer" >> "$HOME/.profile"
            echo $PATH_ADD >> "$HOME/.profile"
            echo >> "$HOME/.profile"
        else
            if ! [ -z $VERB ]; then echo "$HOME/.local/share/dotnet/bin already detected in ~/.profile, skip adding to \$PATH."; fi
        fi

        BASH_ADD='[[ ":$PATH:" != *":$HOME/.local/share/dotnet/bin:"* ]] && export PATH="${PATH}:$HOME/.local/share/dotnet/bin"'
         
        if ! (grep -qF "$BASH_ADD" $HOME/.bashrc); then
            if ! [ -z $VERB ]; then echo "Adding $HOME/.local/share/dotnet/bin to user ~/.bashrc..."; fi
            echo "# Added by .NET Core installer" >> "$HOME/.bashrc"
            echo $BASH_ADD >> "$HOME/.bashrc"
            echo >> "$HOME/.bashrc"
        else
            if ! [ -z $VERB ]; then echo "$HOME/.local/share/dotnet/bin already detected in ~/.bashrc, skip adding to ~/.bashrc."; fi
        fi
        
        echo '.NET runtime installed successfully. You may need to log-out and back in or type ". ~/.profile" for the changes to take effect.'
        exit 0
    else
        echo "Install failed: Error encountered while extracting dotnet-runtime.tar.gz"
        exit 1
    fi
}

download_runtime() {
    case "$OS_ID" in
        "ubuntu")
            ubuntu_fetch
            return 0
            ;;
{'fraction_non_alphanumeric': 0.1594758064516129, 'fraction_numerical': 0.010483870967741936, 'mean_word_length': 1.9372409709887508, 'pattern_counts': {'":': 4, '<': 3, '<?xml version=': 0, '>': 31, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3303291', 'n_tokens_mistral': 1699, 'n_tokens_neox': 1604, 'n_words': 420}