<commit_before>#!/bin/bash

RCFILE=".bashrc"
RCPATH="$HOME/$RCFILE"

echo "~ Installing TMC-CLI ~"
echo "This install script assumes you are using Bash."
echo "If you are using another shell, please add 'source $HOME/.tmc-autocomplete.sh' in your shell's rc file after TMC-CLI has been installed."
echo ""

if [ ! -f $RCPATH ]; then
	echo -e "$RCPATH not found, creating"
	echo ""
	touch $RCPATH
fi

if [ -f $HOME/.tmc-autocomplete.sh ]; then
# If .tmc-autocomplete.sh is already in user's home dir, don't download it
	if ! ((grep -Fxq "source $HOME/.tmc-autocomplete.sh" $RCPATH) \
	|| (grep -Fxq "source \$HOME/.tmc-autocomplete.sh" $RCPATH) \
	|| (grep -Fxq "source ~/.tmc-autocomplete.sh" $RCPATH)); then
		echo -e ".tmc-autocomplete already exists in $HOME, but is not sourced in $RCFILE"
		echo -e "Adding to $RCPATH"
		echo "" >> $RCPATH
		echo "source $HOME/.tmc-autocomplete.sh" >> $RCPATH
		exit
	else
		echo "TMC-CLI is already installed. Did you forget to source your rc file?"
		echo -e "Try 'source $RCPATH'."
		exit
	fi
fi
echo "Fetching latest release URL"
URL=$(curl -s https://api.github.com/repos/tmc-cli/tmc-cli/releases/latest | grep '"browser_download_url"' | grep '/tmc"' | head -n 1 | cut -d '"' -f 4)
echo "Downloading TMC-CLI"<commit_msg>Fix link<commit_after>#!/bin/bash

RCFILE=".bashrc"
RCPATH="$HOME/$RCFILE"

echo "~ Installing TMC-CLI ~"
echo "This install script assumes you are using Bash."
echo "If you are using another shell, please add 'source $HOME/.tmc-autocomplete.sh' in your shell's rc file after TMC-CLI has been installed."
echo ""

if [ ! -f $RCPATH ]; then
	echo -e "$RCPATH not found, creating"
	echo ""
	touch $RCPATH
fi

if [ -f $HOME/.tmc-autocomplete.sh ]; then
# If .tmc-autocomplete.sh is already in user's home dir, don't download it
	if ! ((grep -Fxq "source $HOME/.tmc-autocomplete.sh" $RCPATH) \
	|| (grep -Fxq "source \$HOME/.tmc-autocomplete.sh" $RCPATH) \
	|| (grep -Fxq "source ~/.tmc-autocomplete.sh" $RCPATH)); then
		echo -e ".tmc-autocomplete already exists in $HOME, but is not sourced in $RCFILE"
		echo -e "Adding to $RCPATH"
		echo "" >> $RCPATH
		echo "source $HOME/.tmc-autocomplete.sh" >> $RCPATH
		exit
	else
		echo "TMC-CLI is already installed. Did you forget to source your rc file?"
		echo -e "Try 'source $RCPATH'."
		exit
	fi
fi
echo "Fetching latest release URL"
URL=$(curl -s https://api.github.com/repos/testmycode/tmc-cli/releases/latest | grep '"browser_download_url"' | grep '/tmc"' | head -n 1 | cut -d '"' -f 4)
echo "Downloading TMC-CLI"
{'fraction_non_alphanumeric': 0.15241488519398258, 'fraction_numerical': 0.001583531274742676, 'mean_word_length': 3.6537753222836096, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1830645', 'n_tokens_mistral': 1011, 'n_tokens_neox': 934, 'n_words': 304}