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

#set -e 
cd "${0%/*}"
cd .. && source dotfiles.conf;
cd "${init}"

if [ ! -n "$ZSH" ]; then
  ZSH="${zsh_dst}"
fi

dedupepath(){
    if [ -n "$PATH" ]
    then
        old_PATH=$PATH:
        PATH=
        while [ -n "$old_PATH" ]
        do
            x=${old_PATH%%:*}
            case $PATH: in
                (*:"$x":*)  ;;
                (*) PATH=$PATH:$x  ;;
            esac
            old_PATH=${old_PATH#*:}
        done
        PATH=${PATH#:}
        unset old_PATH x
    fi
}

makeZshrc(){
    echo "${color}Making ${zshrc} file...${reset}"
    [ -e "${zshrc}" ] &&  mv "${zshrc}" ~/.zshrc.orig
    touch "${zshrc}"
    echo "## OS specific settings ############################" >> ${zshrc}
    # TODO: add profiles, rsync, ant, atom, autoenv, vim-interaction, virtualenv, command-not-found, dirhistory, & all the git plugins ???
    if [[ "$OSTYPE" =~ ^(linux)+ ]]; then
        # TODO: detect linux flavor with cat /etc/issue ? in order to load debian plugin
        echo plugins=\(git git-extras brew sudo tmux colored-man extract zsh_reload common-aliases fasd debian\) >> ${zshrc}
    # TODO: test for homebrew... 
        # echo "export HOMEBREW_CASK_OPTS' --appdir=~/Applications --caskroom=$(brew --prefix)/Caskroom'" >> ${zshrc}
        module purge
    elif [[ "$OSTYPE" =~ ^(darwin)+ ]]; then
        echo plugins=\(git git-extras brew sudo tmux tmuxinator colored-man vundle web-search extract zsh_reload copyfile copydir common-aliases npm ant fasd aws osx-aliases osx brew-cask xcode\) >> ${zshrc} 
        echo "export HOMEBREW_CASK_OPTS='--appdir=/Applications --caskroom=$(brew --prefix)/Caskroom'" >> ${zshrc}
        # TODO: make this automatic
        echo "export ECLIPSE_HOME=$(brew --prefix)/Caskroom/eclipse-java/4.4.1/eclipse" >> ${zshrc}
        echo "export ECLIPSE_HOME=$(brew --prefix)/Caskroom/eclipse-java/4.4.1/eclipse" >> ${zshrc}
    fi

cat <<EOF >> "${zshrc}"

## ZSH settings ####################################
export ZSH=$ZSH 
ZSH_THEME="wm"

#CASE_SENSITIVE="true"

DISABLE_AUTO_UPDATE="true"
#DISABLE_UPDATE_PROMPT=true
#UPDATE_ZSH_DAYS=3

#DISABLE_LS_COLORS="true"

#DISABLE_AUTO_TITLE="true"

ENABLE_CORRECTION="true"

#COMPLETION_WAITING_DOTS="true"

DISABLE_UNTRACKED_FILES_DIRTY="true"

# formats: "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
#HIST_STAMPS="mm/dd/yyyy"

#ZSH_CUSTOM=/path/to/new-custom-folder

export _FASD_DATA=~/.cache/fasd
export _FASD_CACHE=~/.cache/fasd_cache
export ZSH_CACHE_DIR=~/.cache
export ZSH_COMPDUMP="\${ZDOTDIR:-${HOME}}/${ZSH_CACHE_DIR}/.zcompdump-\${SHORT_HOST}-\${ZSH_VERSION}"

## EXPORTS ############################################
export PATH="$(brew --prefix)/bin:$(brew --prefix)/sbin:$PATH"
export MANPATH="$(brew --prefix)/share/man:$MANPATH"
export INFOPATH="$(brew --prefix)/share/info:$INFOPATH"

export PYTHONSTARTUP=~/.pythonrc.py

# Compilation flags
# export ARCHFLAGS="-arch x86_64"

# ssh
# export SSH_KEY_PATH="~/.ssh/dsa_id"

# Preferred editor for local and remote sessions
# if [[ -n \$SSH_CONNECTION ]]; then
#   export EDITOR='vim'
# else
#   export EDITOR='vim'
# fi<commit_msg>zsh cache dump now respects environment variables<commit_after>#!/usr/bin/env bash

#set -e 
cd "${0%/*}"
cd .. && source dotfiles.conf;
cd "${init}"

if [ ! -n "$ZSH" ]; then
  ZSH="${zsh_dst}"
fi

dedupepath(){
    if [ -n "$PATH" ]
    then
        old_PATH=$PATH:
        PATH=
        while [ -n "$old_PATH" ]
        do
            x=${old_PATH%%:*}
            case $PATH: in
                (*:"$x":*)  ;;
                (*) PATH=$PATH:$x  ;;
            esac
            old_PATH=${old_PATH#*:}
        done
        PATH=${PATH#:}
        unset old_PATH x
    fi
}

makeZshrc(){
    echo "${color}Making ${zshrc} file...${reset}"
    [ -e "${zshrc}" ] &&  mv "${zshrc}" ~/.zshrc.orig
    touch "${zshrc}"
    echo "## OS specific settings ############################" >> ${zshrc}
    # TODO: add profiles, rsync, ant, atom, autoenv, vim-interaction, virtualenv, command-not-found, dirhistory, & all the git plugins ???
    if [[ "$OSTYPE" =~ ^(linux)+ ]]; then
        # TODO: detect linux flavor with cat /etc/issue ? in order to load debian plugin
        echo plugins=\(git git-extras brew sudo tmux colored-man extract zsh_reload common-aliases fasd debian\) >> ${zshrc}
    # TODO: test for homebrew... 
        # echo "export HOMEBREW_CASK_OPTS' --appdir=~/Applications --caskroom=$(brew --prefix)/Caskroom'" >> ${zshrc}
        module purge
    elif [[ "$OSTYPE" =~ ^(darwin)+ ]]; then
        echo plugins=\(git git-extras brew sudo tmux tmuxinator colored-man vundle web-search extract zsh_reload copyfile copydir common-aliases npm ant fasd aws osx-aliases osx brew-cask xcode\) >> ${zshrc} 
        echo "export HOMEBREW_CASK_OPTS='--appdir=/Applications --caskroom=$(brew --prefix)/Caskroom'" >> ${zshrc}
        # TODO: make this automatic
        echo "export ECLIPSE_HOME=$(brew --prefix)/Caskroom/eclipse-java/4.4.1/eclipse" >> ${zshrc}
        echo "export ECLIPSE_HOME=$(brew --prefix)/Caskroom/eclipse-java/4.4.1/eclipse" >> ${zshrc}
    fi

cat <<EOF >> "${zshrc}"

## ZSH settings ####################################
export ZSH=$ZSH 
ZSH_THEME="wm"

#CASE_SENSITIVE="true"

DISABLE_AUTO_UPDATE="true"
#DISABLE_UPDATE_PROMPT=true
#UPDATE_ZSH_DAYS=3

#DISABLE_LS_COLORS="true"

#DISABLE_AUTO_TITLE="true"

ENABLE_CORRECTION="true"

#COMPLETION_WAITING_DOTS="true"

DISABLE_UNTRACKED_FILES_DIRTY="true"

# formats: "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
#HIST_STAMPS="mm/dd/yyyy"

#ZSH_CUSTOM=/path/to/new-custom-folder

export _FASD_DATA=~/.cache/fasd
export _FASD_CACHE=~/.cache/fasd_cache
export ZSH_CACHE_DIR=~/.cache
export ZSH_COMPDUMP="${ZDOTDIR:-${HOME}}/${ZSH_CACHE_DIR}/.zcompdump-${SHORT_HOST}-${ZSH_VERSION}"

## EXPORTS ############################################
export PATH="$(brew --prefix)/bin:$(brew --prefix)/sbin:$PATH"
export MANPATH="$(brew --prefix)/share/man:$MANPATH"
export INFOPATH="$(brew --prefix)/share/info:$INFOPATH"

export PYTHONSTARTUP=~/.pythonrc.py

# Compilation flags
# export ARCHFLAGS="-arch x86_64"

# ssh
# export SSH_KEY_PATH="~/.ssh/dsa_id"

# Preferred editor for local and remote sessions
# if [[ -n \$SSH_CONNECTION ]]; then
#   export EDITOR='vim'
# else
#   export EDITOR='vim'
# fi
{'fraction_non_alphanumeric': 0.20228825679326234, 'fraction_numerical': 0.003813761322103925, 'mean_word_length': 3.4512022630834513, 'pattern_counts': {'":': 2, '<': 7, '<?xml version=': 0, '>': 35, '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': '3550713', 'n_tokens_mistral': 2363, 'n_tokens_neox': 2264, 'n_words': 471}