#!/usr/bin/env bash set -e echo "[+] Cloning submodules..." git submodule update --init --recursive find . -type d -name '.git*' -prune -o -type f -print0 | xargs -0 dos2unix > /dev/null 2>&1 echo "[+] Creating Gitconfigs..." ( for config in $PWD/.gitconfig.d/*.gitconfig; do echo "[include]" echo " path = $config" done; ) > "$HOME/.gitconfig" echo "[+] Creating symlinks..." if [ ! -f "$PWD/.zshenv" ]; then cp "$PWD/.zshenv.template" "$PWD/.zshenv" SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" sed -i "s|^export DOTFILES_INSTALL_DIR=.*|export DOTFILES_INSTALL_DIR=${SCRIPT_DIR}|" .zshenv fi stow .