# HG changeset patch # User Edho Prima Arief # Date 1319622754 -25200 # Node ID 7c01fc6f7460726f8ab2bb1dfe98b9860c305df0 # Parent 5bafb912837e1077efa31949895e5c5109290f46 Better install script. diff -r 5bafb912837e -r 7c01fc6f7460 setup --- a/setup Wed Oct 26 15:22:00 2011 +0700 +++ b/setup Wed Oct 26 16:52:34 2011 +0700 @@ -28,10 +28,13 @@ ln -fs "${PWD}/${1}" "${HOME}/${2}" } -uninstall_tcsh() { - if [ -f "${HOME}/.cshrc" ]; then - grep -v '#ECCORE_TCSH' "${HOME}/.cshrc" > .cleancshrc - mv .cleancshrc "${HOME}/.cshrc" +uninstall_init() { + script="${1}" + scripttmp="${1}.new.tmp" + hashdata="${2}" + if [ -f "${script}" ]; then + grep -v "${hashdata}" "${script}" > "${scripttmp}" + mv "${scripttmp}" "${script}" fi } @@ -42,7 +45,10 @@ rm -f "${HOME}/${i}" fi done - uninstall_tcsh + uninstall_init "${HOME}/.cshrc" "#ECCORE_TCSH" + uninstall_init "${HOME}/.bashrc" "#ECCORE_BASH" + uninstall_init "${HOME}/.bash_profile" "#ECCORE_BASH" + uninstall_init "${HOME}/.zshrc" "#ECCORE_ZSH" } update() {