-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy_dotfiles.sh
More file actions
executable file
·43 lines (39 loc) · 1017 Bytes
/
deploy_dotfiles.sh
File metadata and controls
executable file
·43 lines (39 loc) · 1017 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
36
37
38
39
40
41
42
43
#!/bin/zsh
dotfiles=$HOME/.dotfiles
oldfiles=$HOME/.dotfiles.old
count=0; for i in `ls -A1 $dotfiles`
do
((count++))
if [[ (($count -gt 0)) ]]
then
if [[ -d $dotfiles ]]
then
if [[ (($i != 'gvimrc') && ($i != 'profile.bak')
&& ($i != 'vim.old') && ($i != 'vimrc.old')
&& ($i != 'deploy_dotfiles.sh') && ($i != '.git')
&& ($i != 'power.sh'))]]
then
echo $dotfiles 'exists ...'
if [[ -e $HOME/.$i ]]
then
if [[ -d $oldfiles ]]
then
echo 'Moving' $i 'to' $oldfiles
mv -f $HOME/.$i $oldfiles
else
echo 'Creating' $oldfiles '...'
mkdir $oldfiles
echo 'Moving' $i 'to' $oldfiles
mv -f $HOME/.$i $oldfiles
fi
fi
echo 'Linking' $i 'in' $dotfiles
echo ''
ln -sf $dotfiles/$i $HOME/.$i
fi
else
echo 'Whoops! Your dotfiles directory is not at' $dotfiles
fi
fi
done
echo 'All done!'