diff options
author | Shubham Saini <shubham6405@gmail.com> | 2019-12-22 12:03:39 +0000 |
---|---|---|
committer | Shubham Saini <shubham6405@gmail.com> | 2019-12-22 12:03:39 +0000 |
commit | d3a50583212a40a62d0bc29d05cc1ce2694c8a27 (patch) | |
tree | 9514bc1bf2a9160a22a1dab1f79a3c0f5552f0f8 /bin/.local/bin/dotstow | |
parent | 364aef77ed7b8267b3223e2c5dce946b83aa694d (diff) |
changes
Diffstat (limited to 'bin/.local/bin/dotstow')
-rwxr-xr-x | bin/.local/bin/dotstow | 21 |
1 files changed, 21 insertions, 0 deletions
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 @@ | |||
1 | #!/bin/bash | ||
2 | |||
3 | # This script will Stow all the dotfiles located in the ~/dotfiles folder. | ||
4 | # The -R flag is used to force a 'restow' which will remove any existing symlinks before attempting to Stow. | ||
5 | |||
6 | echo "Stowing Dotfiles..."; | ||
7 | |||
8 | cd ~/dotfiles | ||
9 | for file in ~/dotfiles/*; do | ||
10 | # Only run Stow on the directories in the dotfiles folder and not the individual files. | ||
11 | # Using 'basename' strips the filepath from the directory name. | ||
12 | if [ -d ${file} ]; then | ||
13 | stow -R $(basename $file) | ||
14 | echo "$(basename $file) stowed."; | ||
15 | fi | ||
16 | done | ||
17 | |||
18 | # Return back to the your PWD from before you ran the script | ||
19 | cd ~- | ||
20 | |||
21 | echo 'All stowed'; | ||