<commit_before>#!/bin/bash
#------------------------------------------------------------
# Install bash profile and RC files from this project.
#------------------------------------------------------------

safe_copy () {
    SRC=$1
    DST=$2
    if [ -f ~/$2 ]; then
	cp -p ~/$2 ~/$2.orig
	echo "backup made ~/$2 => ~/$2.orig"
    fi
    cp $1 $2
}

safe_copy bash_profile ~/.bash_profile
safe_copy bashrc ~/.bashrc
safe_copy bashrc.Darwin ~/.bashrc.Darwin
safe_copy bashrc.Linux ~/.bashrc.Linux

safe_copy git-completion.sh ~/.git-completion.sh
safe_copy git-prompt.sh ~/.git-prompt.sh

#--------------------------------------------------

echo "$0 done"

#============================================================
# done
#============================================================<commit_msg>Correct backup and copy logic.<commit_after>#!/bin/bash
#------------------------------------------------------------
# Install bash profile and RC files from this project.
#------------------------------------------------------------

safe_copy () {
    SRC=$1
    DST=${HOME}/.$1
    if [ -f ${DST} ]; then
	cp -p ${DST} ${DST}.orig
	echo "backup made ${DST} => ${DST}.orig"
    fi
    cp ${SRC} ${DST}
    echo "installed ${SRC} as new ${DST}"
}

safe_copy bash_profile
safe_copy bashrc
safe_copy bashrc.Darwin
safe_copy bashrc.Linux

safe_copy git-completion.sh
safe_copy git-prompt.sh

#--------------------------------------------------

echo "$0 done"

#============================================================
# done
#============================================================
{'fraction_non_alphanumeric': 0.4663733500942803, 'fraction_numerical': 0.008170961659333752, 'mean_word_length': 1.7213675213675215, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '2286748', 'n_tokens_mistral': 454, 'n_tokens_neox': 411, 'n_words': 108}