From d3a50583212a40a62d0bc29d05cc1ce2694c8a27 Mon Sep 17 00:00:00 2001 From: Shubham Saini Date: Sun, 22 Dec 2019 17:33:39 +0530 Subject: changes --- bin/.local/bin/dotstow | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100755 bin/.local/bin/dotstow (limited to 'bin/.local/bin/dotstow') diff --git a/bin/.local/bin/dotstow b/bin/.local/bin/dotstow new file mode 100755 index 0000000..bcadc5e --- /dev/null +++ b/bin/.local/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