This repository has been archived by the owner on Nov 28, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathinstall.sh
executable file
·80 lines (64 loc) · 1.9 KB
/
install.sh
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#!/usr/bin/env bash
# http://www.unixcl.com/2008/03/creating-menus-using-select-bash.html
# http://askubuntu.com/questions/1705/how-can-i-create-a-select-menu-in-a-shell-script
# http://tldp.org/LDP/Bash-Beginners-Guide/html/sect_09_06.html
# http://unix.stackexchange.com/questions/257290
# http://www.thegeekstuff.com/2010/07/bash-case-statement/
# Install files:
function install() {
now=`date '+%Y%m%d%H%M%S'`;
# Switch to user’s home directory:
cd $HOME
if (($1)); then
#zip -r archive_name.zip noexist.foo > /dev/null 2>&1
zip -r "dotfizzles.$now.zip" \
".virtualenvs" \
".bash_profile" \
".bash" \
".bashrc" \
".curlrc" \
".gemrc" \
".gitconfig" \
".gitignore" \
".hushlogin" \
".inputrc" \
".mkshrc" \
".npmrc" \
".profile" \
".scripts" \
".zshrc" \
"mm.cfg" \
> /dev/null 2>&1
fi
# Get the zip file and extract all files:
curl -sS -#L https://github.com/mhulse/dotfizzles/tarball/master | tar -xzv --strip-components 1 --exclude={install.sh,README.md}
# Let the use know that we are done:
echo $'\n'"--------------------------------------------------------------"
echo "Congrats! Installation was successful!"
echo "Run \"source ~/.bash_profile\" to reload your session."
echo "Optimally, it’s probably a good idea to restart your computer."
echo -e "\e[4mhttps://github.com/mhulse/dotfizzles\e[24m"
exit 0
}
# Ask the user if they want to backup their previous fizzles:
function choose() {
read -p "Back up previous versions (y/n)? " choice
case "$choice" in
y|Y)
install 1
;;
n|N)
install
;;
*)
echo "Your choice (${choice}) does not compute. Goodbye."
;;
esac
}
# Tidy up the terminal window:
clear
# Create menu:
choose
# Done!
# For more information about this script, see:
# https://github.com/mhulse/dotfizzles