Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Refactoring install script

  • Loading branch information...
commit effb6a4b70580c1a48c6226f9dcadf825ce061eb 1 parent f5b7d82
@lucascaton authored
Showing with 12 additions and 14 deletions.
  1. +12 −14 install.sh
View
26 install.sh
@@ -1,18 +1,16 @@
#! /bin/bash
-echo -ne '\nInitializing...\n\n'
+NO_COLOR="\033[1;0m"
+GREEN="\033[0;32m"
+export GRAY="\033[1;30m"
-files=(bash_profile gitconfig irbrc psqlrc rvmrc)
+echo -ne "\n${GREEN}Initializing...\n\n"
-echo -ne '=> Backup your dotfiles'
-for ((i = 0; i < ${#files[@]}; i++)) do
- echo -ne '.'; sleep 0.1
- if [ -s ~/.${files[$i]} ]; then mv ~/.${files[$i]} ~/.${files[$i]}.bkp; fi
-done; echo -ne '\n'
+echo -e "Creating backup + creating symlinks to new dotfiles..."
+echo -e "${GRAY}"
+cd files; for file in *; do
+ echo "~/.$file"
+ if [ -s ~/.$file ]; then mv ~/.$file ~/.$file.bkp; fi
+ ln -s ~/.dotfiles/files/$file ~/.$file
+done
-echo -ne '=> Create symlinks to new dotfiles'
-for ((i = 0; i < ${#files[@]}; i++)) do
- echo -ne '.'; sleep 0.1
- ln -s ~/.dotfiles/files/${files[$i]} ~/.${files[$i]}
-done; echo -ne '\n'
-
-echo -ne '\nDone :-)\n\n'
+echo -ne "\n${GREEN}Done! :-)${NO_COLOR}\n\n"
Please sign in to comment.
Something went wrong with that request. Please try again.