From 1ff834e2b06761b083df9959d6c3d6bd2a94d2de Mon Sep 17 00:00:00 2001 From: Shubham Saini Date: Tue, 1 Dec 2020 20:21:04 +0000 Subject: mah thinkpad --- bin/.bin/dotstow | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100755 bin/.bin/dotstow (limited to 'bin/.bin/dotstow') diff --git a/bin/.bin/dotstow b/bin/.bin/dotstow new file mode 100755 index 0000000..bcadc5e --- /dev/null +++ b/bin/.bin/dotstow @@ -0,0 +1,21 @@ +#!/bin/bash + +# This script will Stow all the dotfiles located in the ~/dotfiles folder. +# The -R flag is used to force a 'restow' which will remove any existing symlinks before attempting to Stow. + +echo "Stowing Dotfiles..."; + +cd ~/dotfiles +for file in ~/dotfiles/*; do + # Only run Stow on the directories in the dotfiles folder and not the individual files. + # Using 'basename' strips the filepath from the directory name. + if [ -d ${file} ]; then + stow -R $(basename $file) + echo "$(basename $file) stowed."; + fi +done + +# Return back to the your PWD from before you ran the script +cd ~- + +echo 'All stowed'; -- cgit v1.2.3