SDB_AC_SRC_PATH=${INSTALLED_PATH}/tools/${SDB_AC_NAME}
SDB_AC_DST_PATH=${SDB_SETTING_PATH}/${SDB_AC_NAME}
BASH_RC=~/.bashrc
+ENABLE_SDB_COMPLETION="# Enable programmable sdb completion features.\nif [ -f ~/.sdb/.sdb-completion.bash ]; then\n source ~/.sdb/.sdb-completion.bash\nfi"
rm -rf ${SDB_SETTING_PATH}
mkdir -p ${SDB_SETTING_PATH}
if [ -f "${BASH_RC}" ]; then
if [ -z $(grep "source ~/\.sdb/\.sdb-completion\.bash" "${BASH_RC}") ]; then
- echo -e "# Enable programmable sdb completion features.\nsource ~/.sdb/.sdb-completion.bash\n" >> "${BASH_RC}"
+ echo -e $ENABLE_SDB_COMPLETION >> "${BASH_RC}"
fi
else
- echo -e "# Enable programmable sdb completion features.\nsource ~/.sdb/.sdb-completion.bash\n" >> "${BASH_RC}"
+ echo -e $SDB_ENABLE_COMPLETION >> "${BASH_RC}"
fi
-# . /etc/bash_completion
-
exit 0
#!/bin/bash -ex
SDB_PATH=tools/sdb
+
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
+ sed -i -E '/# Enable programmable sdb completion features/,/fi/d' ~/.bashrc
fi
exit 0
-