Skip to content

Commit

Permalink
security suggestion from github
Browse files Browse the repository at this point in the history
  • Loading branch information
Ira Abramov committed Jan 22, 2025
1 parent 6e7ed71 commit 1927ddf
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion clean_files.txt
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ themes/pete
themes/powerline
themes/pure
themes/purity

themes/rjorgenson

# vendor init files
#
Expand Down
18 changes: 10 additions & 8 deletions themes/rjorgenson/rjorgenson.theme.bash
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# shellcheck shell=bash
# shellcheck disable=SC2034,SC2154

# port of zork theme

Expand Down Expand Up @@ -31,15 +32,16 @@ esac
PS3=">> "

__my_rvm_ruby_version() {
local gemset=$(echo $GEM_HOME | awk -F'@' '{print $2}')
[ "$gemset" != "" ] && gemset="@$gemset"
local version=$(echo $MY_RUBY_HOME | awk -F'-' '{print $2}')
local full="$version$gemset"
[ "$full" != "" ] && echo "${BRACKET_COLOR}[${STRING_COLOR}$full${BRACKET_COLOR}]${normal}"
local gemset version full
gemset=$(echo "$GEM_HOME" | awk -F'@' '{print $2}')
[[ "$gemset" != "" ]] && gemset="@$gemset"
version=$(echo "$MY_RUBY_HOME" | awk -F'-' '{print $2}')
full="$version$gemset"
[[ "$full" != "" ]] && echo "${BRACKET_COLOR}[${STRING_COLOR}$full${BRACKET_COLOR}]${normal}"
}

is_vim_shell() {
if [ ! -z "$VIMRUNTIME" ]; then
if [[ -n "$VIMRUNTIME" ]]; then
echo "${BRACKET_COLOR}[${STRING_COLOR}vim shell${BRACKET_COLOR}]${normal}"
fi
}
Expand All @@ -50,9 +52,9 @@ function is_integer() { # helper function for todo-txt-count
}

todo_txt_count() {
if $(hash todo.sh 2>&-); then # is todo.sh installed
if hash todo.sh 2>&-; then # is todo.sh installed
count=$(todo.sh ls | grep -E "TODO: [0-9]+ of ([0-9]+) tasks shown" | awk '{ print $4 }')
if is_integer $count; then # did we get a sane answer back
if is_integer "$count"; then # did we get a sane answer back
echo "${BRACKET_COLOR}[${STRING_COLOR}T:$count${BRACKET_COLOR}]$normal"
fi
fi
Expand Down

0 comments on commit 1927ddf

Please sign in to comment.