Skip to content

Commit 815d9fc

Browse files
committed
Koichi is really good at Bash Pokemon...
1 parent fd42f44 commit 815d9fc

File tree

9 files changed

+48
-59
lines changed

9 files changed

+48
-59
lines changed

themes/mairan/mairan.theme.bash

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,9 @@ __my_rvm_ruby_version() {
6161
local version gemset
6262
gemset=$(echo "${GEM_HOME}" | awk -F'@' '{print $2}')
6363
[[ -n "${gemset}" ]] && gemset="@${gemset}"
64-
local version
6564
version=$(echo "${MY_RUBY_HOME}" | awk -F'-' '{print $2}')
6665
local full="${version}${gemset}"
67-
[[ "${full}" != "" ]] && echo "[${full}]"
66+
[[ -n "${full}" ]] && echo "[${full}]"
6867
}
6968

7069
is_vim_shell() {

themes/modern-time/modern-time.theme.bash

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ esac
2525
PS3=">> "
2626

2727
is_vim_shell() {
28-
if [ ! -z "$VIMRUNTIME" ]; then
28+
if [[ -n "$VIMRUNTIME" ]]; then
2929
echo "[${cyan?}vim shell${normal?}]"
3030
fi
3131
}
@@ -35,15 +35,15 @@ modern_current_time_prompt() {
3535
}
3636

3737
prompt() {
38-
SCM_PROMPT_FORMAT='[%s][%s]'
39-
# shellcheck disable=SC2181
4038
if [ $? -ne 0 ]; then
39+
SCM_PROMPT_FORMAT='[%s][%s]'
4140
# Yes, the indenting on these is weird, but it has to be like
4241
# this otherwise it won't display properly.
4342

4443
PS1="${TITLEBAR}${bold_red?}┌─${reset_color?}$(scm_prompt)$(modern_current_time_prompt)[${cyan?}\W${normal?}]$(is_vim_shell)
4544
${bold_red?}└─▪${normal?} "
4645
else
46+
SCM_PROMPT_FORMAT='[%s][%s]'
4747
PS1="${TITLEBAR}┌─$(scm_prompt)$(modern_current_time_prompt)[${cyan?}\W${normal?}]$(is_vim_shell)
4848
└─▪ "
4949
fi

themes/nwinkler_random_colors/nwinkler_random_colors.theme.bash

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -23,24 +23,24 @@ function randomize_nwinkler {
2323

2424
# shellcheck disable=SC2206 # Expected behavior but fine for this theme.
2525
AVAILABLE_COLORS=(
26-
${black?}
27-
${red?}
28-
${green?}
29-
${yellow?}
30-
${blue?}
31-
${purple?}
32-
${cyan?}
33-
${white?}
34-
${orange?}
35-
${bold_black?}
36-
${bold_red?}
37-
${bold_green?}
38-
${bold_yellow?}
39-
${bold_blue?}
40-
${bold_purple?}
41-
${bold_cyan?}
42-
${bold_white?}
43-
${bold_orange?}
26+
"${black?}"
27+
"${red?}"
28+
"${green?}"
29+
"${yellow?}"
30+
"${blue?}"
31+
"${purple?}"
32+
"${cyan?}"
33+
"${white?}"
34+
"${orange?}"
35+
"${bold_black?}"
36+
"${bold_red?}"
37+
"${bold_green?}"
38+
"${bold_yellow?}"
39+
"${bold_blue?}"
40+
"${bold_purple?}"
41+
"${bold_cyan?}"
42+
"${bold_white?}"
43+
"${bold_orange?}"
4444
)
4545
# Uncomment these to allow underlines:
4646
#$underline_black

themes/parrot/parrot.theme.bash

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# shellcheck shell=bash
22
# shellcheck disable=SC2034 # Expected behavior for themes.
33

4-
git branch parser
4+
# git branch parser
55
function parse_git_branch() {
66
echo -e "\[\033[1;34m\]$(git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/')\[\033[0m\]"
77
}

themes/ramses/ramses.theme.bash

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,21 +27,21 @@ PS3=">> "
2727
__my_rvm_ruby_version() {
2828
local version gemset
2929
gemset=$(echo "$GEM_HOME" | awk -F'@' '{print $2}')
30-
[ "$gemset" != "" ] && gemset="@$gemset"
30+
[[ -n "$gemset" ]] && gemset="@$gemset"
3131
version=$(echo "$MY_RUBY_HOME" | awk -F'-' '{print $2}')
3232
local full="$version$gemset"
33-
[ "$full" != "" ] && echo "[$full]"
33+
[[ -n "$full" ]] && echo "[$full]"
3434
}
3535

3636
is_vim_shell() {
37-
if [ ! -z "$VIMRUNTIME" ]; then
37+
if [[ -n "$VIMRUNTIME" ]]; then
3838
echo "[${cyan?}vim shell${normal?}]"
3939
fi
4040
}
4141

4242
# show chroot if exist
4343
chroot() {
44-
if [ -n "$debian_chroot" ]; then
44+
if [[ -n "$debian_chroot" ]]; then
4545
my_ps_chroot="${bold_cyan?}$debian_chroot${normal?}"
4646
echo "($my_ps_chroot)"
4747
fi
@@ -50,7 +50,7 @@ chroot() {
5050
# show virtualenvwrapper
5151
my_ve() {
5252

53-
if [ -n "$CONDA_DEFAULT_ENV" ]; then
53+
if [[ -n "$CONDA_DEFAULT_ENV" ]]; then
5454
my_ps_ve="${bold_purple?}${CONDA_DEFAULT_ENV}${normal?}"
5555
echo "($my_ps_ve)"
5656
elif [ -n "$VIRTUAL_ENV" ]; then

themes/rana/rana.theme.bash

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -90,14 +90,14 @@ case $TERM in
9090
esac
9191

9292
is_vim_shell() {
93-
if [ ! -z "$VIMRUNTIME" ]; then
93+
if [[ -n "$VIMRUNTIME" ]]; then
9494
echo "${D_INTERMEDIATE_COLOR}on ${D_VIMSHELL_COLOR}\
9595
vim shell${D_DEFAULT_COLOR} "
9696
fi
9797
}
9898

9999
mitsuhikos_lastcommandfailed() {
100-
code=$?
100+
local code=$?
101101
if [ $code != 0 ]; then
102102
echo "${D_INTERMEDIATE_COLOR}exited ${D_CMDFAIL_COLOR}\
103103
$code ${D_DEFAULT_COLOR}"
@@ -106,7 +106,7 @@ $code ${D_DEFAULT_COLOR}"
106106

107107
# vcprompt for scm instead of bash_it default
108108
demula_vcprompt() {
109-
if [ ! -z "$VCPROMPT_EXECUTABLE" ]; then
109+
if [[ -n "$VCPROMPT_EXECUTABLE" ]]; then
110110
local D_VCPROMPT_FORMAT="on ${D_SCM_COLOR}%s${D_INTERMEDIATE_COLOR}:\
111111
${D_BRANCH_COLOR}%b %r ${D_CHANGES_COLOR}%m%u ${D_DEFAULT_COLOR}"
112112
$VCPROMPT_EXECUTABLE -f "$D_VCPROMPT_FORMAT"
@@ -118,10 +118,7 @@ prompt_git() {
118118
local branchName=''
119119

120120
# Check if the current directory is in a Git repository.
121-
if [ "$(
122-
git rev-parse --is-inside-work-tree &> /dev/null
123-
echo "${?}"
124-
)" == '0' ]; then
121+
if git rev-parse --is-inside-work-tree &> /dev/null; then
125122

126123
# check if the current directory is in .git before running git checks
127124
if [ "$(git rev-parse --is-inside-git-dir 2> /dev/null)" == 'false' ]; then

themes/sirup/sirup.theme.bash

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,13 @@
55
GIT_PS1_SHOWDIRTYSTATE="enabled"
66

77
function rvm_version_prompt {
8-
local gemset
8+
local gemset version
99
gemset=$(echo "$GEM_HOME" | awk -F'@' '{print $2}')
10-
11-
[ "$gemset" != "" ] && gemset="@$gemset"
12-
local version
10+
[[ -n "$gemset" ]] && gemset="@$gemset"
1311
version=$(echo "$MY_RUBY_HOME" | awk -F'-' '{print $2}')
14-
15-
[ "$version" == "1.9.2" ] && version=""
16-
12+
[[ "$version" == "1.9.2" ]] && version=""
1713
local full="$version$gemset"
18-
19-
[ "$full" != "" ] && echo "$full"
14+
[[ -n "$full" ]] && echo "$full"
2015
}
2116

2217
function prompt_command() {

themes/slick/slick.theme.bash

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,23 +25,22 @@ esac
2525
PS3=">> "
2626

2727
__my_rvm_ruby_version() {
28-
local gemset
28+
local gemset version
2929
gemset=$(echo "$GEM_HOME" | awk -F'@' '{print $2}')
30-
[ "$gemset" != "" ] && gemset="@$gemset"
31-
local version
30+
[[ "$gemset" ]] && gemset="@$gemset"
3231
version=$(echo "$MY_RUBY_HOME" | awk -F'-' '{print $2}')
3332
local full="$version$gemset"
34-
[ "$full" != "" ] && echo "[$full]"
33+
[[ "$full" ]] && echo "[$full]"
3534
}
3635

3736
__my_venv_prompt() {
38-
if [ ! -z "$VIRTUAL_ENV" ]; then
37+
if [[ -n "$VIRTUAL_ENV" ]]; then
3938
echo "[${blue?}@${normal?}${VIRTUAL_ENV##*/}]"
4039
fi
4140
}
4241

4342
is_vim_shell() {
44-
if [ ! -z "$VIMRUNTIME" ]; then
43+
if [[ -n "$VIMRUNTIME" ]]; then
4544
echo "[${cyan?}vim shell${normal?}]"
4645
fi
4746
}

themes/zork/zork.theme.bash

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,24 +25,23 @@ esac
2525
PS3=">> "
2626

2727
__my_rvm_ruby_version() {
28-
local gemset
28+
local gemset version
2929
gemset=$(echo "$GEM_HOME" | awk -F'@' '{print $2}')
30-
[ "$gemset" != "" ] && gemset="@$gemset"
31-
local version
30+
[[ -n "$gemset" ]] && gemset="@$gemset"
3231
version=$(echo "$MY_RUBY_HOME" | awk -F'-' '{print $2}')
3332
local full="$version$gemset"
34-
[ "$full" != "" ] && echo "[$full]"
33+
[[ -n "$full" ]] && echo "[$full]"
3534
}
3635

3736
is_vim_shell() {
38-
if [ ! -z "$VIMRUNTIME" ]; then
37+
if [[ -n "$VIMRUNTIME" ]]; then
3938
echo "[${cyan?}vim shell${normal?}]"
4039
fi
4140
}
4241

4342
# show chroot if exist
4443
chroot() {
45-
if [ -n "$debian_chroot" ]; then
44+
if [[ -n "$debian_chroot" ]]; then
4645
my_ps_chroot="${bold_cyan?}$debian_chroot${normal?}"
4746
echo "($my_ps_chroot)"
4847
fi
@@ -51,10 +50,10 @@ chroot() {
5150
# show virtualenvwrapper
5251
my_ve() {
5352

54-
if [ -n "$CONDA_DEFAULT_ENV" ]; then
53+
if [[ -n "$CONDA_DEFAULT_ENV" ]]; then
5554
my_ps_ve="${bold_purple?}${CONDA_DEFAULT_ENV}${normal?}"
5655
echo "($my_ps_ve)"
57-
elif [ -n "$VIRTUAL_ENV" ]; then
56+
elif [[ -n "$VIRTUAL_ENV" ]]; then
5857
my_ps_ve="${bold_purple?}$ve${normal?}"
5958
echo "($my_ps_ve)"
6059
fi

0 commit comments

Comments
 (0)