in ~/.basrc, scripts for enabling sdb autocomplete is inserted.
Removed those scripts when sdb is uninstalled
Change-Id: Ib1fb0b1699e35c6dfc696259048a58f40fe28064
Signed-off-by: ho.namkoong <ho.namkoong@samsung.com>
if [ -f "${BASH_RC}" ]; then
if [ -z $(grep "source ~/\.sdb/\.sdb-completion\.bash" "${BASH_RC}") ]; then
- echo -e "\n# Enable programmable sdb completion features.\nsource ~/.sdb/.sdb-completion.bash\n" >> "${BASH_RC}"
+ echo -e "# Enable programmable sdb completion features.\nsource ~/.sdb/.sdb-completion.bash\n" >> "${BASH_RC}"
fi
else
- echo -e "\n# Enable programmable sdb completion features.\nsource ~/.sdb/.sdb-completion.bash\n" >> "${BASH_RC}"
+ echo -e "# Enable programmable sdb completion features.\nsource ~/.sdb/.sdb-completion.bash\n" >> "${BASH_RC}"
fi
# . /etc/bash_completion
#!/bin/bash -ex
SDB_PATH=tools/sdb
-${INSTALLED_PATH}/${SDB_PATH} kill-server
-SDB_AC_NAME=sdb-autocomplete
+if [ -f ${INSTALLED_PATH}/${SDB_PATH}]; then
+ ${INSTALLED_PATH}/${SDB_PATH} kill-server
+fi
rm -rf ${INSTALLED_PATH}/${SDB_PATH}
rm -rf ~/.sdb
+if [ -f ~/.bashrc ]; then
+ sed -i -E '/# Enable programmable sdb completion features\.|source ~\/\.sdb\/\.sdb-completion\.bash/d' ~/.bashrc
+fi
exit 0