annotate setup @ 64:3cd3f31d8a82

Added zsh!
author Edho Prima Arief <me@myconan.net>
date Tue, 17 May 2011 13:28:50 -0400
parents 684a22aeb675
children e6aa07cf62cc
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
ddd721f10cb8 Unified installer/uninstaller.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
1 #!/bin/sh
ddd721f10cb8 Unified installer/uninstaller.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
2
ddd721f10cb8 Unified installer/uninstaller.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
3 install() {
5
de6ce93d40fc Added action message. Fixed missed files.
Edho Prima Arief <me@myconan.net>
parents: 4
diff changeset
4 uninstall
1
ddd721f10cb8 Unified installer/uninstaller.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
5 #create symlinks
ddd721f10cb8 Unified installer/uninstaller.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
6 linker "tcsh" ".tcsh_init"
47
684a22aeb675 [setup] .blah.hur => .blah_hur
Edho Prima Arief <me@myconan.net>
parents: 46
diff changeset
7 linker "bash" ".ecos_bash"
64
3cd3f31d8a82 Added zsh!
Edho Prima Arief <me@myconan.net>
parents: 47
diff changeset
8 linker "zsh" ".ecos_zsh"
1
ddd721f10cb8 Unified installer/uninstaller.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
9 linker "tmux" ".tmux.conf"
ddd721f10cb8 Unified installer/uninstaller.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
10 linker "hg" ".hgrc"
3
39ef7f7236fc Added vimrc.
Edho Prima Arief <me@myconan.net>
parents: 1
diff changeset
11 linker "vim" ".vimrc"
6
2ae8e6222b9d Added inputrc.
Edho Prima Arief <me@myconan.net>
parents: 5
diff changeset
12 linker "inputrc" ".inputrc"
17
73123c5ef818 ~/bin-ec -> ~/.ecos.bin
Edho Prima Arief <me@myconan.net>
parents: 8
diff changeset
13 #originally bin-ec. Renamed to .ecos.bin for sanity when listing home
47
684a22aeb675 [setup] .blah.hur => .blah_hur
Edho Prima Arief <me@myconan.net>
parents: 46
diff changeset
14 #and replaced . with _ for more sanity
684a22aeb675 [setup] .blah.hur => .blah_hur
Edho Prima Arief <me@myconan.net>
parents: 46
diff changeset
15 linker "bin" ".ecos_bin"
1
ddd721f10cb8 Unified installer/uninstaller.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
16
ddd721f10cb8 Unified installer/uninstaller.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
17 #modify cshrc
ddd721f10cb8 Unified installer/uninstaller.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
18 echo '[ -r "${HOME}/.tcsh_init" ] && source "${HOME}/.tcsh_init" #ECCORE_TCSH' >> "${HOME}/.cshrc"
44
1f1af28f36e9 [bash] Bashrc, c-style ifdef.
Edho Prima Arief <me@myconan.net>
parents: 40
diff changeset
19 #modify bash_profile and bashrc
47
684a22aeb675 [setup] .blah.hur => .blah_hur
Edho Prima Arief <me@myconan.net>
parents: 46
diff changeset
20 echo '[ -r "${HOME}/.ecos_bash" ] && . "${HOME}/.ecos_bash" #ECCORE_BASH' >> "${HOME}/.bash_profile"
684a22aeb675 [setup] .blah.hur => .blah_hur
Edho Prima Arief <me@myconan.net>
parents: 46
diff changeset
21 echo '[ -r "${HOME}/.ecos_bash" ] && . "${HOME}/.ecos_bash" #ECCORE_BASH' >> "${HOME}/.bashrc"
1
ddd721f10cb8 Unified installer/uninstaller.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
22 }
ddd721f10cb8 Unified installer/uninstaller.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
23
ddd721f10cb8 Unified installer/uninstaller.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
24 linker() {
5
de6ce93d40fc Added action message. Fixed missed files.
Edho Prima Arief <me@myconan.net>
parents: 4
diff changeset
25 echo "Creating symlink: ${1} => ~/${2}"
1
ddd721f10cb8 Unified installer/uninstaller.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
26 ln -fs "${PWD}/${1}" "${HOME}/${2}"
ddd721f10cb8 Unified installer/uninstaller.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
27 }
ddd721f10cb8 Unified installer/uninstaller.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
28
ddd721f10cb8 Unified installer/uninstaller.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
29 uninstall_tcsh() {
46
65f98c2936c1 [setup] Why use -e when it should be -f
Edho Prima Arief <me@myconan.net>
parents: 44
diff changeset
30 if [ -f "${HOME}/.cshrc" ]; then
1
ddd721f10cb8 Unified installer/uninstaller.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
31 grep -v '#ECCORE_TCSH' "${HOME}/.cshrc" > .cleancshrc
ddd721f10cb8 Unified installer/uninstaller.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
32 mv .cleancshrc "${HOME}/.cshrc"
ddd721f10cb8 Unified installer/uninstaller.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
33 fi
ddd721f10cb8 Unified installer/uninstaller.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
34 }
ddd721f10cb8 Unified installer/uninstaller.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
35
ddd721f10cb8 Unified installer/uninstaller.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
36 uninstall() {
17
73123c5ef818 ~/bin-ec -> ~/.ecos.bin
Edho Prima Arief <me@myconan.net>
parents: 8
diff changeset
37 for i in .tcsh_init .tmux.conf .hgrc .vimrc .inputrc bin-ec .ecos.bin; do
46
65f98c2936c1 [setup] Why use -e when it should be -f
Edho Prima Arief <me@myconan.net>
parents: 44
diff changeset
38 if [ -f "${HOME}/${i}" ]; then
5
de6ce93d40fc Added action message. Fixed missed files.
Edho Prima Arief <me@myconan.net>
parents: 4
diff changeset
39 echo "Removing file: ~/${i}"
de6ce93d40fc Added action message. Fixed missed files.
Edho Prima Arief <me@myconan.net>
parents: 4
diff changeset
40 rm -f "${HOME}/${i}"
de6ce93d40fc Added action message. Fixed missed files.
Edho Prima Arief <me@myconan.net>
parents: 4
diff changeset
41 fi
1
ddd721f10cb8 Unified installer/uninstaller.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
42 done
ddd721f10cb8 Unified installer/uninstaller.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
43 uninstall_tcsh
ddd721f10cb8 Unified installer/uninstaller.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
44 }
ddd721f10cb8 Unified installer/uninstaller.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
45
26
175848778e77 Added initial upgrade support.
Edho Prima Arief <me@myconan.net>
parents: 23
diff changeset
46 update() {
29
5db1b912f66b Update now with message
Edho Prima Arief <me@myconan.net>
parents: 26
diff changeset
47 if [ -f "${HOME}/.tcsh_exec" ]; then
5db1b912f66b Update now with message
Edho Prima Arief <me@myconan.net>
parents: 26
diff changeset
48 mv -f "${HOME}/.tcsh_exec" "${HOME}/.tcsh_init.after"
5db1b912f66b Update now with message
Edho Prima Arief <me@myconan.net>
parents: 26
diff changeset
49 echo "Moved: ${HOME}/.tcsh_exec => ${HOME}/.tcsh_init.after"
5db1b912f66b Update now with message
Edho Prima Arief <me@myconan.net>
parents: 26
diff changeset
50 fi
26
175848778e77 Added initial upgrade support.
Edho Prima Arief <me@myconan.net>
parents: 23
diff changeset
51 }
175848778e77 Added initial upgrade support.
Edho Prima Arief <me@myconan.net>
parents: 23
diff changeset
52
23
738a2da8b79c Added usage information for setup script.
Edho Prima Arief <me@myconan.net>
parents: 17
diff changeset
53 help() {
738a2da8b79c Added usage information for setup script.
Edho Prima Arief <me@myconan.net>
parents: 17
diff changeset
54 cat <<EOF
738a2da8b79c Added usage information for setup script.
Edho Prima Arief <me@myconan.net>
parents: 17
diff changeset
55 Usage: ${0} [install|uninstall]
738a2da8b79c Added usage information for setup script.
Edho Prima Arief <me@myconan.net>
parents: 17
diff changeset
56 EOF
738a2da8b79c Added usage information for setup script.
Edho Prima Arief <me@myconan.net>
parents: 17
diff changeset
57 }
738a2da8b79c Added usage information for setup script.
Edho Prima Arief <me@myconan.net>
parents: 17
diff changeset
58
1
ddd721f10cb8 Unified installer/uninstaller.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
59 case "$1" in
ddd721f10cb8 Unified installer/uninstaller.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
60 install)
ddd721f10cb8 Unified installer/uninstaller.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
61 install
ddd721f10cb8 Unified installer/uninstaller.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
62 ;;
ddd721f10cb8 Unified installer/uninstaller.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
63 uninstall)
ddd721f10cb8 Unified installer/uninstaller.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
64 uninstall
ddd721f10cb8 Unified installer/uninstaller.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
65 ;;
26
175848778e77 Added initial upgrade support.
Edho Prima Arief <me@myconan.net>
parents: 23
diff changeset
66 update)
175848778e77 Added initial upgrade support.
Edho Prima Arief <me@myconan.net>
parents: 23
diff changeset
67 update
175848778e77 Added initial upgrade support.
Edho Prima Arief <me@myconan.net>
parents: 23
diff changeset
68 ;;
23
738a2da8b79c Added usage information for setup script.
Edho Prima Arief <me@myconan.net>
parents: 17
diff changeset
69 *)
738a2da8b79c Added usage information for setup script.
Edho Prima Arief <me@myconan.net>
parents: 17
diff changeset
70 help
738a2da8b79c Added usage information for setup script.
Edho Prima Arief <me@myconan.net>
parents: 17
diff changeset
71 ;;
1
ddd721f10cb8 Unified installer/uninstaller.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
72 esac