<commit_before>#!/bin/bash

# stolen from http://blog.smalleycreative.com/tutorials/using-git-and-github-to-manage-your-dotfiles/
# This script creates symlinks from the home directory to any desired dotfiles in $dir
# places old files in $olddir as backup

# Todos
# make idempotent

# Requirements
# this repo in ~/dotfiles
# can be run from anywhere

dir=~/dotfiles
backup=~/dotfiles_old
targets=".bash_profile .vimrc .gitconfig .tmux.conf .vim"

echo "running init.."

# create backup dir if neccessary
mkdir -pv $backup 

# move any existing targets in ~ to backup and create symlinks
echo "moving any existing files to backup dir before symlinking"
for target in $targets; do
    if [ -f ~/$target ]; then
        mv -iv ~/$target $backup
        ln -sv $dir/src/$target ~/$target
    fi
done
echo done<commit_msg>no only move non-links<commit_after>#!/bin/bash

# stolen from http://blog.smalleycreative.com/tutorials/using-git-and-github-to-manage-your-dotfiles/
# This script creates symlinks from the home directory to any desired dotfiles in $dir
# places old files in $olddir as backup

# Todos
# make idempotent

# Requirements
# this repo in ~/dotfiles
# can be run from anywhere

dir=~/dotfiles
backup=~/dotfiles_old
targets=".bash_profile .vimrc .gitconfig .tmux.conf .vim"

echo "running init.."

# create backup dir if neccessary
mkdir -pv $backup 

# move any non-links to backup and create symlinks
for target in $targets; do
    if [ ! -h ~/$target ]; then
        mv -iv ~/$target $backup
        ln -sv $dir/src/$target ~/$target
    fi
done
echo done
{'fraction_non_alphanumeric': 0.10419313850063533, 'fraction_numerical': 0.0, 'mean_word_length': 3.5258620689655173, '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': '1381237', 'n_tokens_mistral': 534, 'n_tokens_neox': 498, 'n_words': 184}