# HG changeset patch # User Edho Prima Arief # Date 1320162021 -25200 # Node ID 6a110770a756056d2ca08bf64a56e5987cabe35a # Parent cf328bd0607828f48f59e9a091e3aa34623866e5 A bit more sanity testing. diff -r cf328bd06078 -r 6a110770a756 setup --- a/setup Mon Oct 31 11:54:49 2011 +0700 +++ b/setup Tue Nov 01 22:40:21 2011 +0700 @@ -44,17 +44,22 @@ } _rc() { + if test -z "${3}" || test -z "${2}" || test -z "${1}"; then + _echo "Invalid command." + return + fi _srcfile="${rcdir}/${2}" _dstfile="${HOME}/${3}" if test ! -h "${_dstfile}"; then if test -f "${_dstfile}"; then cp "${_dstfile}" "${_dstfile}.bak" + _echo "${_dstfile} backed up to ${_dstfile}.bak" elif test -d "${_dstfile}"; then cp -r "${_dstfile}" "${_dstfile}.bak" + _echo "Directory ${_dstfile} backed up to ${_dstfile}.bak" fi - _echo "${_dstfile} backed up to ${_dstfile}.bak" fi - rm -f "${_dstfile}" + rm -rf "${_dstfile}" case "${1}" in install) ln -fs "${_srcfile}" "${_dstfile}"