#!/usr/bin/env bash # Deploys the dotfiles in this directory using GNU stow set -euo pipefail # Get this script's directory SCRIPT_DIR=$(readlink -f "$(dirname "${BASH_SOURCE[0]}")") # Change to the dotfiles directory (push current dir on the stack) pushd "$SCRIPT_DIR" > /dev/null || exit 1 # Loop through non-hidden top-level dirs and stow them for dir in */; do [[ $dir == .* || $dir == secrets/ ]] && continue # Skip dot-directories echo "Stowing $dir" if ! stow "$dir"; then errorcode=$? echo "Error stowing $dir" fi done # Return to original directory popd > /dev/null || exit 1 exit "${errorcode:-0}"