annotate setup @ 19:b975a587f8f6

Commented insane zero-remover from renamer.
author Edho Prima Arief <me@myconan.net>
date Fri, 20 Aug 2010 09:49:15 +0700
parents b5d0c1892294
children 73123c5ef818
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"
ddd721f10cb8 Unified installer/uninstaller.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
7 linker "tmux" ".tmux.conf"
ddd721f10cb8 Unified installer/uninstaller.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
8 linker "hg" ".hgrc"
3
39ef7f7236fc Added vimrc.
Edho Prima Arief <me@myconan.net>
parents: 1
diff changeset
9 linker "vim" ".vimrc"
6
2ae8e6222b9d Added inputrc.
Edho Prima Arief <me@myconan.net>
parents: 5
diff changeset
10 linker "inputrc" ".inputrc"
4
94ee419ad047 Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents: 3
diff changeset
11 linker "bin" "bin-ec"
1
ddd721f10cb8 Unified installer/uninstaller.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
12
ddd721f10cb8 Unified installer/uninstaller.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
13 #modify cshrc
ddd721f10cb8 Unified installer/uninstaller.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
14 echo '[ -r "${HOME}/.tcsh_init" ] && source "${HOME}/.tcsh_init" #ECCORE_TCSH' >> "${HOME}/.cshrc"
ddd721f10cb8 Unified installer/uninstaller.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
15 }
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 linker() {
5
de6ce93d40fc Added action message. Fixed missed files.
Edho Prima Arief <me@myconan.net>
parents: 4
diff changeset
18 echo "Creating symlink: ${1} => ~/${2}"
1
ddd721f10cb8 Unified installer/uninstaller.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
19 ln -fs "${PWD}/${1}" "${HOME}/${2}"
ddd721f10cb8 Unified installer/uninstaller.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
20 }
ddd721f10cb8 Unified installer/uninstaller.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
21
ddd721f10cb8 Unified installer/uninstaller.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
22 uninstall_tcsh() {
ddd721f10cb8 Unified installer/uninstaller.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
23 if [ -e "${HOME}/.cshrc" ]; then
ddd721f10cb8 Unified installer/uninstaller.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
24 grep -v '#ECCORE_TCSH' "${HOME}/.cshrc" > .cleancshrc
ddd721f10cb8 Unified installer/uninstaller.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
25 mv .cleancshrc "${HOME}/.cshrc"
ddd721f10cb8 Unified installer/uninstaller.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
26 fi
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() {
8
b5d0c1892294 Forgot to add remover for inputrc
Edho Prima Arief <me@myconan.net>
parents: 6
diff changeset
30 for i in .tcsh_init .tmux.conf .hgrc .vimrc .inputrc bin-ec; do
5
de6ce93d40fc Added action message. Fixed missed files.
Edho Prima Arief <me@myconan.net>
parents: 4
diff changeset
31 if [ -e "${HOME}/${i}" ]; then
de6ce93d40fc Added action message. Fixed missed files.
Edho Prima Arief <me@myconan.net>
parents: 4
diff changeset
32 echo "Removing file: ~/${i}"
de6ce93d40fc Added action message. Fixed missed files.
Edho Prima Arief <me@myconan.net>
parents: 4
diff changeset
33 rm -f "${HOME}/${i}"
de6ce93d40fc Added action message. Fixed missed files.
Edho Prima Arief <me@myconan.net>
parents: 4
diff changeset
34 fi
1
ddd721f10cb8 Unified installer/uninstaller.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
35 done
ddd721f10cb8 Unified installer/uninstaller.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
36 uninstall_tcsh
ddd721f10cb8 Unified installer/uninstaller.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
37 }
ddd721f10cb8 Unified installer/uninstaller.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
38
ddd721f10cb8 Unified installer/uninstaller.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
39 case "$1" in
ddd721f10cb8 Unified installer/uninstaller.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
40 install)
ddd721f10cb8 Unified installer/uninstaller.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
41 install
ddd721f10cb8 Unified installer/uninstaller.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
42 ;;
ddd721f10cb8 Unified installer/uninstaller.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
43 uninstall)
ddd721f10cb8 Unified installer/uninstaller.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
44 uninstall
ddd721f10cb8 Unified installer/uninstaller.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
45 ;;
ddd721f10cb8 Unified installer/uninstaller.
Edho Prima Arief <me@myconan.net>
parents:
diff changeset
46 esac