-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·35 lines (28 loc) · 991 Bytes
/
Copy pathsetup.sh
File metadata and controls
executable file
·35 lines (28 loc) · 991 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/bin/bash
############################
# .setup.sh
# This script creates symlinks from the home directory to any desired dotfiles in ~/dotfiles
############################
########## Variables
dir=~/dotfiles # dotfiles directory # old d
backup=~/dotfiles.backup/setup/
#files=".zshrc .aliases .functions .todo-cli" # list of files/folders to symlink in homedir
files=".gitignore .gitconfig .hushlogin .zshrc .aliases .functions .todo-cli"
##########
# create dotfiles_old in homedir
echo "Creating $backup for backup of any existing dotfiles"
mkdir -p $backup
echo "...done"
# change to the dotfiles directory
echo -n "Changing to the $dir directory ..."
cd $dir
echo "done"
for file in $files; do
echo "Moving any existing dotfiles from ~ to $backup"
cp -R ~/$file $backup
echo "Copied $file to $backup"
rm -R ~/$file
echo "Deleted $file"
echo "Creating symlink to $file in home directory."
ln -s $dir/$file ~/$file
done