--- a/.bash_prompt Wed Aug 27 03:54:46 2014 +0900
+++ b/.bash_prompt Wed Aug 27 14:40:49 2014 +0900
function prompt_command {
- local RESET="\[\e[0m\]"
- local TIME="${G}\t${RESET}"
- if [[ ${EUID} == 0 ]] ; then
+ if [[ $EUID == 0 ]] ; then
# getting hg and git info is disabled for root
- # testing if current dir is a part of hg repo
+ # testing if current dir is a part of hg/git repo
TEST_DIR=$(dirname "$TEST_DIR")
- if [[ "$HG_TRACKED" ]] ; then
+ if [[ $HG_TRACKED ]] ; then
local SUM=$(LC_ALL=C hg sum 2>/dev/null)
local PARENTS=($(grep -Po '(?<=parent: ).*(?=:)' <<< "$SUM"))
local BRANCH=$(grep -Po '(?<=branch: ).*$' <<< "$SUM")
local HG_INFO=" ${P}${BRANCH}☿${REV}${R}${UPDATE}${G}${MERGEREV}${R}${COMMIT}${RESET}"
- if [[ "$GIT_TRACKED" ]] ; then
+ if [[ $GIT_TRACKED ]] ; then
local GIT_STATUS=$(LC_ALL=C git status 2>/dev/null)
local GIT_BRANCH=$(grep -Po '(?<=On branch ).*$' <<< "$GIT_STATUS")
- if [[ "$VIRTUAL_ENV" ]] ; then
+ if [[ $VIRTUAL_ENV ]] ; then
local VENV="${G}+"$(basename "$VIRTUAL_ENV")"${RESET}"
- if [[ "$RETURN_CODE" != 0 ]] ; then
+ if [[ $RETURN_CODE != 0 ]] ; then
local RETCODE="${R}${RETURN_CODE}${RESET} "
${PROMPT_COLOR}\\\$${RESET} "
-export VIRTUAL_ENV_DISABLE_PROMPT="1"
+export VIRTUAL_ENV_DISABLE_PROMPT=1
export PROMPT_COMMAND=prompt_command