From 7f0395a1d0e3f8c3cba7a4b2f0b8b718b34a87ba Mon Sep 17 00:00:00 2001 From: guneysus Date: Sat, 17 Jan 2015 23:41:01 +0200 Subject: [PATCH 01/30] Powerturk theme derived from powerline theme --- themes/powerturk/powerturk.theme.bash | 185 ++++++++++++++++++++++++++ 1 file changed, 185 insertions(+) create mode 100644 themes/powerturk/powerturk.theme.bash diff --git a/themes/powerturk/powerturk.theme.bash b/themes/powerturk/powerturk.theme.bash new file mode 100644 index 00000000..ccda0b39 --- /dev/null +++ b/themes/powerturk/powerturk.theme.bash @@ -0,0 +1,185 @@ +#!/usr/bin/env bash +# Power-Turk theme for bash-it +# Author (C) 2015 Ahmed Seref Guneysu + +THEME_PROMPT_SEPARATOR="" + +SHELL_SSH_CHAR=" " +SHELL_THEME_PROMPT_COLOR=2 +SHELL_SSH_THEME_PROMPT_COLOR=208 + +VIRTUALENV_CHAR="ⓔ " +VIRTUALENV_THEME_PROMPT_COLOR=35 + +SCM_NONE_CHAR="" + +SCM_GIT_CHAR=" " # " " + +SCM_THEME_PROMPT_CLEAN="" +SCM_THEME_PROMPT_DIRTY="" + +SCM_THEME_PROMPT_COLOR=16 +SCM_THEME_PROMPT_CLEAN_COLOR=231 +SCM_THEME_PROMPT_DIRTY_COLOR=196 +SCM_THEME_PROMPT_STAGED_COLOR=220 +SCM_THEME_PROMPT_UNSTAGED_COLOR=166 + +CWD_THEME_PROMPT_COLOR=240 + +LAST_STATUS_THEME_PROMPT_COLOR=52 + +_collapsed_wd() { + # echo -e "\u2771\u276d\u276f" + echo $(pwd | perl -pe " + BEGIN { + binmode STDIN, ':encoding(UTF-8)'; + binmode STDOUT, ':encoding(UTF-8)'; + }; s|^$HOME||g; s|/([^/])[^/]*(?=/)|/\$1|g") | \ + sed -re "s/\//  /g" +} + +_swd(){ +# Adapted from http://stackoverflow.com/a/2951707/1766716 + begin="" # The unshortened beginning of the path. + shortbegin="" # The shortened beginning of the path. + current="" # The section of the path we're currently working on. + end="${2:-$(pwd)}/" # The unmodified rest of the path. + + if [[ "$end" =~ "$HOME" ]]; then + INHOME=1 + end="${end#$HOME}" #strip /home/username from start of string + begin="$HOME" #start expansion from the right spot + else + INHOME=0 + fi + + end="${end#/}" # Strip the first / + shortenedpath="$end" # The whole path, to check the length. + maxlength="${1:-0}" + + shopt -q nullglob && NGV="-s" || NGV="-u" # Store the value for later. + shopt -s nullglob # Without this, anything that doesn't exist in the filesystem turns into */*/*/... + + while [[ "$end" ]] && (( ${#shortenedpath} > maxlength )) + do + current="${end%%/*}" # everything before the first / + end="${end#*/}" # everything after the first / + + shortcur="$current" + shortcurstar="$current" # No star if we don't shorten it. + + for ((i=${#current}-2; i>=0; i--)); do + subcurrent="${current:0:i}" + matching=("$begin/$subcurrent"*) # Array of all files that start with $subcurrent. + (( ${#matching[*]} != 1 )) && break # Stop shortening if more than one file matches. + shortcur="$subcurrent" + shortcurstar="$subcurrent*" + done + + #advance + begin="$begin/$current" + shortbegin="$shortbegin/$shortcurstar" + shortenedpath="$shortbegin/$end" + done + + shortenedpath="${shortenedpath%/}" # strip trailing / + shortenedpath="${shortenedpath#/}" # strip leading / + + # Replaces slashes with  except first occurence. + if [ $INHOME -eq 1 ]; then + echo "~/$shortenedpath" | sed "s/\///2g" # make sure it starts with ~/ + else + echo "/$shortenedpath" | sed "s/\///2g" # Make sure it starts with / + fi + + shopt "$NGV" nullglob # Reset nullglob in case this is being used as a function. + +} +function set_rgb_color { + if [[ "${1}" != "-" ]]; then + fg="38;5;${1}" + fi + if [[ "${2}" != "-" ]]; then + bg="48;5;${2}" + [[ -n "${fg}" ]] && bg=";${bg}" + fi + echo -e "\[\033[${fg}${bg}m\]" +} + +function powerline_shell_prompt { + if [[ -n "${SSH_CLIENT}" ]]; then + SHELL_PROMPT="${bold_white}$(set_rgb_color - ${SHELL_SSH_THEME_PROMPT_COLOR}) ${SHELL_SSH_CHAR}\u@\h ${normal}" + LAST_THEME_COLOR=${SHELL_SSH_THEME_PROMPT_COLOR} + else + SHELL_PROMPT="${bold_white}$(set_rgb_color - ${SHELL_THEME_PROMPT_COLOR}) ${normal}" + LAST_THEME_COLOR=${SHELL_THEME_PROMPT_COLOR} + fi +} + +function powerline_virtualenv_prompt { + local environ="" + + if [[ -n "$CONDA_DEFAULT_ENV" ]]; then + environ="conda: $CONDA_DEFAULT_ENV" + elif [[ -n "$VIRTUAL_ENV" ]]; then + environ=$(basename "$VIRTUAL_ENV") + fi + + if [[ -n "$environ" ]]; then + VIRTUALENV_PROMPT="$(set_rgb_color ${LAST_THEME_COLOR} ${VIRTUALENV_THEME_PROMPT_COLOR})${THEME_PROMPT_SEPARATOR}${normal}$(set_rgb_color - ${VIRTUALENV_THEME_PROMPT_COLOR}) ${VIRTUALENV_CHAR}$environ ${normal}" + LAST_THEME_COLOR=${VIRTUALENV_THEME_PROMPT_COLOR} + else + VIRTUALENV_PROMPT="" + fi +} + +function powerline_scm_prompt { + scm_prompt_vars + + if [[ "${SCM_NONE_CHAR}" != "${SCM_CHAR}" ]]; then + if [[ "${SCM_DIRTY}" -eq 3 ]]; then + SCM_PROMPT="$(set_rgb_color ${SCM_THEME_PROMPT_STAGED_COLOR} ${SCM_THEME_PROMPT_COLOR})" + elif [[ "${SCM_DIRTY}" -eq 2 ]]; then + SCM_PROMPT="$(set_rgb_color ${SCM_THEME_PROMPT_UNSTAGED_COLOR} ${SCM_THEME_PROMPT_COLOR})" + elif [[ "${SCM_DIRTY}" -eq 1 ]]; then + SCM_PROMPT="$(set_rgb_color ${SCM_THEME_PROMPT_DIRTY_COLOR} ${SCM_THEME_PROMPT_COLOR})" + else + SCM_PROMPT="$(set_rgb_color ${SCM_THEME_PROMPT_CLEAN_COLOR} ${SCM_THEME_PROMPT_COLOR})" + fi + if [[ "${SCM_GIT_CHAR}" == "${SCM_CHAR}" ]]; then + SCM_PROMPT+=" ${SCM_CHAR}${SCM_BRANCH}${SCM_STATE}" + fi + SCM_PROMPT="$(set_rgb_color ${LAST_THEME_COLOR} ${SCM_THEME_PROMPT_COLOR})${THEME_PROMPT_SEPARATOR}${normal}${SCM_PROMPT} ${normal}" + LAST_THEME_COLOR=${SCM_THEME_PROMPT_COLOR} + else + SCM_PROMPT="" + fi +} + +function powerline_cwd_prompt { +CWD_PROMPT="$(set_rgb_color ${LAST_THEME_COLOR} ${CWD_THEME_PROMPT_COLOR})${THEME_PROMPT_SEPARATOR}$(set_rgb_color - ${CWD_THEME_PROMPT_COLOR}) $(_swd)${normal}$(set_rgb_color ${CWD_THEME_PROMPT_COLOR} -)${normal}" + LAST_THEME_COLOR=${CWD_THEME_PROMPT_COLOR} +} + +function powerline_last_status_prompt { + if [[ "$1" -eq 0 ]]; then + LAST_STATUS_PROMPT="$(set_rgb_color ${LAST_THEME_COLOR} -)${THEME_PROMPT_SEPARATOR}${normal}" + else + LAST_STATUS_PROMPT="$(set_rgb_color ${LAST_THEME_COLOR} ${LAST_STATUS_THEME_PROMPT_COLOR})${THEME_PROMPT_SEPARATOR}${normal}$(set_rgb_color - ${LAST_STATUS_THEME_PROMPT_COLOR}) ${LAST_STATUS} ${normal}$(set_rgb_color ${LAST_STATUS_THEME_PROMPT_COLOR} -)${THEME_PROMPT_SEPARATOR}${normal}" + fi +} + +function powerline_prompt_command() { + local LAST_STATUS="$?" + + powerline_shell_prompt + powerline_virtualenv_prompt + powerline_scm_prompt + powerline_cwd_prompt + powerline_last_status_prompt LAST_STATUS + + PS1="${SHELL_PROMPT}${VIRTUALENV_PROMPT}${SCM_PROMPT}${CWD_PROMPT}${LAST_STATUS_PROMPT} " +} + +PROMPT_COMMAND=powerline_prompt_command + From 9b07aa85d6fc835edbf908b432de9dac1e07972d Mon Sep 17 00:00:00 2001 From: guneysus Date: Sun, 25 Jan 2015 12:17:03 +0200 Subject: [PATCH 02/30] small mods --- themes/powerturk/powerturk.theme.bash | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/themes/powerturk/powerturk.theme.bash b/themes/powerturk/powerturk.theme.bash index ccda0b39..35404360 100644 --- a/themes/powerturk/powerturk.theme.bash +++ b/themes/powerturk/powerturk.theme.bash @@ -35,7 +35,7 @@ _collapsed_wd() { binmode STDIN, ':encoding(UTF-8)'; binmode STDOUT, ':encoding(UTF-8)'; }; s|^$HOME||g; s|/([^/])[^/]*(?=/)|/\$1|g") | \ - sed -re "s/\//  /g" + sed -re "s/\//  /g" } _swd(){ @@ -70,7 +70,7 @@ _swd(){ for ((i=${#current}-2; i>=0; i--)); do subcurrent="${current:0:i}" - matching=("$begin/$subcurrent"*) # Array of all files that start with $subcurrent. + matching=("$begin/$subcurrent"*) # Array of all files that start with $subcurrent. (( ${#matching[*]} != 1 )) && break # Stop shortening if more than one file matches. shortcur="$subcurrent" shortcurstar="$subcurrent*" @@ -157,7 +157,7 @@ function powerline_scm_prompt { } function powerline_cwd_prompt { -CWD_PROMPT="$(set_rgb_color ${LAST_THEME_COLOR} ${CWD_THEME_PROMPT_COLOR})${THEME_PROMPT_SEPARATOR}$(set_rgb_color - ${CWD_THEME_PROMPT_COLOR}) $(_swd)${normal}$(set_rgb_color ${CWD_THEME_PROMPT_COLOR} -)${normal}" +CWD_PROMPT="$(set_rgb_color ${LAST_THEME_COLOR} ${CWD_THEME_PROMPT_COLOR})${THEME_PROMPT_SEPARATOR}$(set_rgb_color 0 ${CWD_THEME_PROMPT_COLOR}) $(_swd)${normal}$(set_rgb_color ${CWD_THEME_PROMPT_COLOR} -)${normal}" LAST_THEME_COLOR=${CWD_THEME_PROMPT_COLOR} } From 0028dc7661870954e6042305ce7a5bff9d71779c Mon Sep 17 00:00:00 2001 From: Nils Winkler Date: Thu, 31 May 2018 17:57:09 +0200 Subject: [PATCH 03/30] Fixed indentation to two spaces, like in the rest of the file --- bash_it.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/bash_it.sh b/bash_it.sh index 2d085e9d..4b70235f 100755 --- a/bash_it.sh +++ b/bash_it.sh @@ -4,18 +4,18 @@ # Only set $BASH_IT if it's not already set if [ -z "$BASH_IT" ]; then - # Setting $BASH to maintain backwards compatibility - # TODO: warn users that they should upgrade their .bash_profile - export BASH_IT=$BASH - export BASH="$(bash -c 'echo $BASH')" + # Setting $BASH to maintain backwards compatibility + # TODO: warn users that they should upgrade their .bash_profile + export BASH_IT=$BASH + export BASH="$(bash -c 'echo $BASH')" fi # For backwards compatibility, look in old BASH_THEME location if [ -z "$BASH_IT_THEME" ]; then - # TODO: warn users that they should upgrade their .bash_profile - export BASH_IT_THEME="$BASH_THEME"; - unset $BASH_THEME; + # TODO: warn users that they should upgrade their .bash_profile + export BASH_IT_THEME="$BASH_THEME"; + unset $BASH_THEME; fi # Load composure first, so we support function metadata @@ -81,7 +81,7 @@ done unset config_file if [[ $PROMPT ]]; then - export PS1="\[""$PROMPT""\]" + export PS1="\[""$PROMPT""\]" fi # Adding Support for other OSes From 5d99d6cb9bc1c6128b761b21ad6bf23039a4f2bb Mon Sep 17 00:00:00 2001 From: Nils Winkler Date: Thu, 31 May 2018 18:05:25 +0200 Subject: [PATCH 04/30] Fixed some shellcheck warnings Also fixed one broken case of `unset`. --- bash_it.sh | 13 +++++++------ uninstall.sh | 2 +- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/bash_it.sh b/bash_it.sh index 4b70235f..8eea4c6a 100755 --- a/bash_it.sh +++ b/bash_it.sh @@ -7,7 +7,8 @@ then # Setting $BASH to maintain backwards compatibility # TODO: warn users that they should upgrade their .bash_profile export BASH_IT=$BASH - export BASH="$(bash -c 'echo $BASH')" + BASH="$(bash -c 'echo $BASH')" + export BASH fi # For backwards compatibility, look in old BASH_THEME location @@ -15,7 +16,7 @@ if [ -z "$BASH_IT_THEME" ]; then # TODO: warn users that they should upgrade their .bash_profile export BASH_IT_THEME="$BASH_THEME"; - unset $BASH_THEME; + unset BASH_THEME; fi # Load composure first, so we support function metadata @@ -30,9 +31,9 @@ LIB="${BASH_IT}/lib/*.bash" APPEARANCE_LIB="${BASH_IT}/lib/appearance.bash" for config_file in $LIB do - if [ $config_file != $APPEARANCE_LIB ]; then + if [ "$config_file" != "$APPEARANCE_LIB" ]; then # shellcheck disable=SC1090 - source $config_file + source "$config_file" fi done @@ -57,7 +58,7 @@ source "${BASH_IT}/themes/base.theme.bash" # appearance (themes) now, after all dependencies # shellcheck source=./lib/appearance.bash -source $APPEARANCE_LIB +source "$APPEARANCE_LIB" # Load custom aliases, completion, plugins for file_type in "aliases" "completion" "plugins" @@ -75,7 +76,7 @@ for config_file in $CUSTOM do if [ -e "${config_file}" ]; then # shellcheck disable=SC1090 - source $config_file + source "$config_file" fi done diff --git a/uninstall.sh b/uninstall.sh index 18d88e80..17712610 100755 --- a/uninstall.sh +++ b/uninstall.sh @@ -16,7 +16,7 @@ esac BACKUP_FILE=$CONFIG_FILE.bak if [ ! -e "$HOME/$BACKUP_FILE" ]; then - echo -e "\033[0;33mBackup file "$HOME/$BACKUP_FILE" not found.\033[0m" >&2 + echo -e "\033[0;33mBackup file $HOME/$BACKUP_FILE not found.\033[0m" >&2 test -w "$HOME/$CONFIG_FILE" && mv "$HOME/$CONFIG_FILE" "$HOME/$CONFIG_FILE.uninstall" && From 6a5915d0d63ac163154284a535eabe1de34ab365 Mon Sep 17 00:00:00 2001 From: Norbu Tsering Date: Fri, 1 Jun 2018 01:17:03 -0400 Subject: [PATCH 05/30] Added norbu theme --- themes/norbu/norbu.theme.bash | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 themes/norbu/norbu.theme.bash diff --git a/themes/norbu/norbu.theme.bash b/themes/norbu/norbu.theme.bash new file mode 100644 index 00000000..184c13c9 --- /dev/null +++ b/themes/norbu/norbu.theme.bash @@ -0,0 +1,27 @@ +#!/usr/bin/env bash + +function set_prompt_symbol () { + if test $1 -eq 0 ; then + PROMPT_SYMBOL=">_" + else + PROMPT_SYMBOL="${orange}>_${normal}" + fi +} +function prompt_command() { + set_prompt_symbol $? + if test -z "$VIRTUAL_ENV" ; then + PYTHON_VIRTUALENV="" + else + PYTHON_VIRTUALENV="${bold_yellow}[`basename \"$VIRTUAL_ENV\"`]" + fi + + PS1="${bold_orange}${PYTHON_VIRTUALENV}${reset_color}${bold_green}[\w]${bold_blue}\[$(scm_prompt_info)\]${normal} \n${PROMPT_SYMBOL} " +} + +# scm themeing +SCM_THEME_PROMPT_DIRTY=" ✗" +SCM_THEME_PROMPT_CLEAN=" ✓" +SCM_THEME_PROMPT_PREFIX="[" +SCM_THEME_PROMPT_SUFFIX="]" + +safe_append_prompt_command prompt_command From 178c37140c5b98e648393316ddade7cac6b60051 Mon Sep 17 00:00:00 2001 From: Nils Winkler Date: Fri, 1 Jun 2018 08:18:57 +0200 Subject: [PATCH 06/30] Updated theme preview documentation Fixes #1198 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2c078699..022ce442 100644 --- a/README.md +++ b/README.md @@ -200,7 +200,7 @@ export BASH_IT_THEME="powerline-multiline" export BASH_IT_THEME="/home/foo/my_theme/my_theme.theme.bash" ``` -You can easily preview the themes in your own shell using `BASH_PREVIEW=true reload`. +You can easily preview the themes in your own shell using `BASH_PREVIEW=true bash-it reload`. If you've created your own custom prompts, we'd love it if you shared with everyone else! Just submit a Pull Request. You can see theme screenshots on [wiki/Themes](https://github.com/Bash-it/bash-it/wiki/Themes). From a25ac59b849b3fac64feef5040c4c84ef50163ea Mon Sep 17 00:00:00 2001 From: Jonathan Barnes Date: Sun, 3 Jun 2018 10:06:25 -0700 Subject: [PATCH 07/30] Add `codeword` theme - Single line PS1 - Shares history in realtime among bash windows --- themes/codeword/README.md | 22 +++++++++++++++++ themes/codeword/codeword.theme.bash | 38 +++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+) create mode 100644 themes/codeword/README.md create mode 100644 themes/codeword/codeword.theme.bash diff --git a/themes/codeword/README.md b/themes/codeword/README.md new file mode 100644 index 00000000..38201dbf --- /dev/null +++ b/themes/codeword/README.md @@ -0,0 +1,22 @@ +# Single line PS1 theme w/realtime history among windows + + +Minimal theme overrides from bash_it base theming + + +## `user@host:path[virt-env][scm] $` +Breakdown of the segments: + +- **user@host:path** - *convienient for LAN based `ssh` and `scp` tasks* +- [**virtualenv**] - *only appears when activated* +- [**scm**] - *only appears when activated* +- **marker** - *$ or # depending on current user* + +### Examples + +```bash +user@example.lan:~ $ cd /tmp/foo/bar/baz +user@example.lan:/tmp/foo/bar/baz $ cd $HOME/workspace +user@example.lan:~/workspace $ cd sampleRepo/ +user@example.lan:~/workspace/sampleRepo [± |master ↑1 ↓3 {1} S:2 ?:1 ✗|] $ +``` diff --git a/themes/codeword/codeword.theme.bash b/themes/codeword/codeword.theme.bash new file mode 100644 index 00000000..96723ce3 --- /dev/null +++ b/themes/codeword/codeword.theme.bash @@ -0,0 +1,38 @@ +SCM_THEME_PROMPT_PREFIX=${SCM_THEME_PROMPT_SUFFIX} +SCM_THEME_PROMPT_DIRTY="${bold_red} ✗${normal}" +SCM_THEME_PROMPT_CLEAN="${bold_green} ✓${normal}" +SCM_GIT_CHAR="${green}±${normal}" + +scm_prompt() { + CHAR=$(scm_char) + if [ $CHAR = $SCM_NONE_CHAR ] + then + return + else + echo " [$(scm_char)$(scm_prompt_info)]" + fi +} + +mark_prompt() { + echo "${green}\$${normal}" +} + +user_host_path_prompt() { + ps_user="${green}\u${normal}"; + ps_host="${blue}\H${normal}"; + ps_path="${yellow}\w${normal}"; + echo "$ps_user@$ps_host:$ps_path" +} + +prompt() { + PS1="$(user_host_path_prompt)$(virtualenv_prompt)$(scm_prompt) $(mark_prompt) " +} + +share_history() { + history -a + history -c + history -r +} + +safe_append_prompt_command share_history +safe_append_prompt_command prompt From 8b0d752168720de25758df3db64b7267ce38cc22 Mon Sep 17 00:00:00 2001 From: Pablo Palazon Date: Mon, 11 Jun 2018 18:44:54 +0200 Subject: [PATCH 08/30] Add jgit-flow plugin --- plugins/available/jgitflow.plugin.bash | 47 ++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 plugins/available/jgitflow.plugin.bash diff --git a/plugins/available/jgitflow.plugin.bash b/plugins/available/jgitflow.plugin.bash new file mode 100644 index 00000000..a5b816ea --- /dev/null +++ b/plugins/available/jgitflow.plugin.bash @@ -0,0 +1,47 @@ +cite about-plugin +about-plugin 'Maven jgitflow build helpers' + +function hotfix-start { + about 'helper function for starting a new hotfix' + group 'jgitflow' + + mvn jgitflow:hotfix-start ${JGITFLOW_MVN_ARGUMENTS} +} + +function hotfix-finish { + about 'helper function for finishing a hotfix' + group 'jgitflow' + + mvn jgitflow:hotfix-finish -Darguments="${JGITFLOW_MVN_ARGUMENTS}" && git push && git push origin master && git push --tags +} + +function feature-start { + about 'helper function for starting a new feature' + group 'jgitflow' + + mvn jgitflow:feature-start ${JGITFLOW_MVN_ARGUMENTS} +} + +function feature-finish { + about 'helper function for finishing a feature' + group 'jgitflow' + + mvn jgitflow:feature-finish ${JGITFLOW_MVN_ARGUMENTS} + echo -e '\033[32m----------------------------------------------------------------\033[0m' + echo -e '\033[32m===== REMEMBER CREATE A NEW RELEASE FOR DEPLOY THIS FEATURE ====\033[0m' + echo -e '\033[32m----------------------------------------------------------------\033[0m' +} + +function release-start { + about 'helper function for starting a new release' + group 'jgitflow' + + mvn jgitflow:release-start ${JGITFLOW_MVN_ARGUMENTS} +} + +function release-finish { + about 'helper function for finishing a release' + group 'jgitflow' + + mvn jgitflow:release-finish -Darguments="${JGITFLOW_MVN_ARGUMENTS}" && git push && git push origin master && git push --tags +} From 5387aa025dbeacfee8f726555ad2d6805372559c Mon Sep 17 00:00:00 2001 From: Pablo Palazon Date: Thu, 14 Jun 2018 09:22:45 +0200 Subject: [PATCH 09/30] Corrected grammatical errors --- plugins/available/jgitflow.plugin.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/available/jgitflow.plugin.bash b/plugins/available/jgitflow.plugin.bash index a5b816ea..83ee8a23 100644 --- a/plugins/available/jgitflow.plugin.bash +++ b/plugins/available/jgitflow.plugin.bash @@ -28,7 +28,7 @@ function feature-finish { mvn jgitflow:feature-finish ${JGITFLOW_MVN_ARGUMENTS} echo -e '\033[32m----------------------------------------------------------------\033[0m' - echo -e '\033[32m===== REMEMBER CREATE A NEW RELEASE FOR DEPLOY THIS FEATURE ====\033[0m' + echo -e '\033[32m===== REMEMBER TO CREATE A NEW RELEASE TO DEPLOY THIS FEATURE ====\033[0m' echo -e '\033[32m----------------------------------------------------------------\033[0m' } From 0936e2a0297e4e395d8832bccb0c1d7e3a326b0d Mon Sep 17 00:00:00 2001 From: con-f-use Date: Tue, 26 Jun 2018 13:08:25 +0200 Subject: [PATCH 10/30] Fix wildcards and handle includes in ssh complete Handle includes in `.ssh/config` and fix bug that caused `Host` entries with wildcards in them to be included in the autocomplete suggestions. --- completion/available/ssh.completion.bash | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/completion/available/ssh.completion.bash b/completion/available/ssh.completion.bash index b54202bd..234a6958 100644 --- a/completion/available/ssh.completion.bash +++ b/completion/available/ssh.completion.bash @@ -11,11 +11,16 @@ _sshcomplete() { local OPTIONS=" -- ${CURRENT_PROMPT}" fi - - # parse all defined hosts from .ssh/config - if [ -r "$HOME/.ssh/config" ]; then - COMPREPLY=($(compgen -W "$(grep -i ^Host "$HOME/.ssh/config" | awk '{for (i=2; i<=NF; i++) print $i}' )" ${OPTIONS}) ) - fi + # parse all defined hosts from .ssh/config and files included there + for fl in "$HOME/.ssh/config" \ + $(grep -P "^\s*Include" "$HOME/.ssh/config" | + awk '{for (i=2; i<=NF; i++) print $i}' | + sed "s|^~/|$HOME/|") + do + if [ -r "$fl" ]; then + COMPREPLY=( ${COMPREPLY[@]} $(compgen -W "$(grep -i ^Host "$fl" |grep -v '[*!]' | awk '{for (i=2; i<=NF; i++) print $i}' )" ${OPTIONS}) ) + fi + done # parse all hosts found in .ssh/known_hosts if [ -r "$HOME/.ssh/known_hosts" ]; then From 6eb35644e6c6009c88454c7ca7cfbecdd856b037 Mon Sep 17 00:00:00 2001 From: Adam Wallis Date: Mon, 9 Jul 2018 21:53:27 +0000 Subject: [PATCH 11/30] Add powerline initialization plugin Initializes powerline per the official powerline documentation: https://powerline.readthedocs.io/en/master/usage/shell-prompts.html#bash-prompt --- plugins/available/powerline.plugin.bash | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 plugins/available/powerline.plugin.bash diff --git a/plugins/available/powerline.plugin.bash b/plugins/available/powerline.plugin.bash new file mode 100644 index 00000000..8e148f1e --- /dev/null +++ b/plugins/available/powerline.plugin.bash @@ -0,0 +1,19 @@ +#!/usr/bin/env bash + +cite about-plugin +about-plugin 'enables powerline daemon' + +command -v powerline-daemon &>/dev/null || return +powerline-daemon -q +POWERLINE_BASH_CONTINUATION=1 +POWERLINE_BASH_SELECT=1 +bashPowerlineInit=$(python -c \ + "import os; \ + import powerline;\ + print(os.path.join(os.path.dirname(\ + powerline.__file__),\ + 'bindings', \ + 'bash', \ + 'powerline.sh'))") +[ -e $bashPowerlineInit ] || return +. $bashPowerlineInit From 1a81ca8b8dd3ce086eb5e3daf95ba813fc37b1a4 Mon Sep 17 00:00:00 2001 From: Adam Wallis Date: Mon, 9 Jul 2018 22:14:17 +0000 Subject: [PATCH 12/30] Don't redefine powerline theme functions In the case where a powerline theme is enabled in bash-it, it seems prudent to avoid touching any of these functions. --- plugins/available/powerline.plugin.bash | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/plugins/available/powerline.plugin.bash b/plugins/available/powerline.plugin.bash index 8e148f1e..0388aa37 100644 --- a/plugins/available/powerline.plugin.bash +++ b/plugins/available/powerline.plugin.bash @@ -5,6 +5,13 @@ about-plugin 'enables powerline daemon' command -v powerline-daemon &>/dev/null || return powerline-daemon -q + +#the following should not be executed if bashit powerline themes in use +case "$BASH_IT_THEME" in + *powerline*) + return + ;; +esac POWERLINE_BASH_CONTINUATION=1 POWERLINE_BASH_SELECT=1 bashPowerlineInit=$(python -c \ From f484fadbb194d8db9a1b62b512b4a61e8a756ab3 Mon Sep 17 00:00:00 2001 From: Piotr Rogoza Date: Thu, 12 Jul 2018 06:32:11 +0000 Subject: [PATCH 13/30] The function _git-hide-status is invoked to late --- themes/base.theme.bash | 1 + 1 file changed, 1 insertion(+) diff --git a/themes/base.theme.bash b/themes/base.theme.bash index fda845de..67fa7fa0 100644 --- a/themes/base.theme.bash +++ b/themes/base.theme.bash @@ -389,6 +389,7 @@ function user_host_prompt { # backwards-compatibility function git_prompt_info { + _git-hide-status && return git_prompt_vars echo -e "${SCM_PREFIX}${SCM_BRANCH}${SCM_STATE}${SCM_SUFFIX}" } From af16e9e68b78be9b439f708792dd1b9bea7695f2 Mon Sep 17 00:00:00 2001 From: Gabriel Smadi Date: Sat, 14 Jul 2018 20:39:19 -0400 Subject: [PATCH 14/30] Display only first line of Python 3.7 version --- themes/base.theme.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/base.theme.bash b/themes/base.theme.bash index 12df1d8a..cc56bdff 100644 --- a/themes/base.theme.bash +++ b/themes/base.theme.bash @@ -347,7 +347,7 @@ function condaenv_prompt { } function py_interp_prompt { - py_version=$(python --version 2>&1 | awk '{print "py-"$2;}') || return + py_version=$(python --version 2>&1 | awk 'NR==1{print "py-"$2;}') || return echo -e "${PYTHON_THEME_PROMPT_PREFIX}${py_version}${PYTHON_THEME_PROMPT_SUFFIX}" } From 5ea271a956636caf48391c5c45c08c56693b16c8 Mon Sep 17 00:00:00 2001 From: Yuri V Date: Tue, 17 Jul 2018 17:07:58 +0300 Subject: [PATCH 15/30] =?UTF-8?q?changet=20ruby=20symbol=20to=20?= =?UTF-8?q?=F0=9F=92=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- themes/powerline-plain/powerline-plain.theme.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/powerline-plain/powerline-plain.theme.bash b/themes/powerline-plain/powerline-plain.theme.bash index ce7943c7..53da88b4 100644 --- a/themes/powerline-plain/powerline-plain.theme.bash +++ b/themes/powerline-plain/powerline-plain.theme.bash @@ -25,7 +25,7 @@ RVM_THEME_PROMPT_SUFFIX="" RBENV_THEME_PROMPT_PREFIX="" RBENV_THEME_PROMPT_SUFFIX="" RUBY_THEME_PROMPT_COLOR=161 -RUBY_CHAR=${POWERLINE_RUBY_CHAR:="ⓔ "} +RUBY_CHAR=${POWERLINE_RUBY_CHAR:="💎 "} CWD_THEME_PROMPT_COLOR=240 From e8c3237fb4c485139373ac3aeeb649522c0ba63c Mon Sep 17 00:00:00 2001 From: Adam Wallis Date: Tue, 17 Jul 2018 10:56:36 -0400 Subject: [PATCH 16/30] Use fd for fzf if available on system fd is orders of magnitude faster when searching for files. This patch will force fzf to use fd instead of find. This change is implemented per the recommendation: https://github.com/junegunn/fzf#environment-variables --- plugins/available/fzf.plugin.bash | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/available/fzf.plugin.bash b/plugins/available/fzf.plugin.bash index 69775c75..5aacc37d 100644 --- a/plugins/available/fzf.plugin.bash +++ b/plugins/available/fzf.plugin.bash @@ -6,6 +6,8 @@ about-plugin 'load fzf, if you are using it' [ -f ~/.fzf.bash ] && source ~/.fzf.bash +command -v fd &> /dev/null && export FZF_DEFAULT_COMMAND='fd --type f' + fe() { about "Open the selected file in the default editor" group "fzf" From dd081b6e5f62eb539fd637a956db7d7336d8e72d Mon Sep 17 00:00:00 2001 From: Adam Wallis Date: Tue, 17 Jul 2018 13:52:59 -0400 Subject: [PATCH 17/30] Add plugin for 'jump' Considering FASD has been deprecated, jump does the same thing but is actively maintained! https://github.com/gsamokovarov/jump --- plugins/available/jump.plugin.bash | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100755 plugins/available/jump.plugin.bash diff --git a/plugins/available/jump.plugin.bash b/plugins/available/jump.plugin.bash new file mode 100755 index 00000000..c7b38d28 --- /dev/null +++ b/plugins/available/jump.plugin.bash @@ -0,0 +1,14 @@ +cite about-plugin +about-plugin 'initialize jump (see https://github.com/gsamokovarov/jump)' + +__init_jump() { + command -v jump &> /dev/null + if [ $? -eq 1 ]; then + echo -e "You must install jump before you can use this plugin" + echo -e "See: https://github.com/gsamokovarov/jump" + else + eval "$(jump shell --bind=z)" + fi +} + +__init_jump From e23d26c8fe95911ec3b0c2ce1121ac3be6b02b4f Mon Sep 17 00:00:00 2001 From: con-f-use Date: Wed, 18 Jul 2018 14:52:01 +0200 Subject: [PATCH 18/30] Fix #1210 grep error on MacOS with ssh completion See #1210 --- completion/available/ssh.completion.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/completion/available/ssh.completion.bash b/completion/available/ssh.completion.bash index 234a6958..d5cd6e61 100644 --- a/completion/available/ssh.completion.bash +++ b/completion/available/ssh.completion.bash @@ -13,7 +13,7 @@ _sshcomplete() { # parse all defined hosts from .ssh/config and files included there for fl in "$HOME/.ssh/config" \ - $(grep -P "^\s*Include" "$HOME/.ssh/config" | + $(grep "^\s*Include" "$HOME/.ssh/config" | awk '{for (i=2; i<=NF; i++) print $i}' | sed "s|^~/|$HOME/|") do From ac42a6233c2e620e35090de53e000125be17264b Mon Sep 17 00:00:00 2001 From: Adam Wallis Date: Wed, 18 Jul 2018 09:52:52 -0400 Subject: [PATCH 19/30] Allow jump plugin to fail silently when jump not installed Per recommendations from @nwinkler, allow the jump test to fail silently. This helps in cases where users are SSH'ing in, or for some other reason are using bash-it environment on a foreign machine. --- plugins/available/jump.plugin.bash | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/plugins/available/jump.plugin.bash b/plugins/available/jump.plugin.bash index c7b38d28..bc6f85e1 100755 --- a/plugins/available/jump.plugin.bash +++ b/plugins/available/jump.plugin.bash @@ -2,13 +2,8 @@ cite about-plugin about-plugin 'initialize jump (see https://github.com/gsamokovarov/jump)' __init_jump() { - command -v jump &> /dev/null - if [ $? -eq 1 ]; then - echo -e "You must install jump before you can use this plugin" - echo -e "See: https://github.com/gsamokovarov/jump" - else - eval "$(jump shell --bind=z)" - fi + command -v jump &> /dev/null || return + eval "$(jump shell --bind=z)" } __init_jump From 03e26ef7a4211846a4bd74046b8657b06f3562a0 Mon Sep 17 00:00:00 2001 From: Adam Wallis Date: Wed, 18 Jul 2018 10:11:44 -0400 Subject: [PATCH 20/30] Only initialize FZF_DEFAULT_COMMAND if not already set --- plugins/available/fzf.plugin.bash | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/available/fzf.plugin.bash b/plugins/available/fzf.plugin.bash index 5aacc37d..f2eddeb1 100644 --- a/plugins/available/fzf.plugin.bash +++ b/plugins/available/fzf.plugin.bash @@ -6,7 +6,9 @@ about-plugin 'load fzf, if you are using it' [ -f ~/.fzf.bash ] && source ~/.fzf.bash -command -v fd &> /dev/null && export FZF_DEFAULT_COMMAND='fd --type f' +if [ -z ${FZF_DEFAULT_COMMAND+x} ]; then + command -v fd &> /dev/null && export FZF_DEFAULT_COMMAND='fd --type f' +fi fe() { about "Open the selected file in the default editor" From 4192d07f4f7fa9d56e02b83129f2ec4ce8cf8f6f Mon Sep 17 00:00:00 2001 From: Nils Winkler Date: Thu, 19 Jul 2018 08:58:05 +0200 Subject: [PATCH 21/30] Fixed indentation and a broken character --- lib/helpers.bash | 48 ++++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/lib/helpers.bash b/lib/helpers.bash index e8fc19ba..f67ebea9 100644 --- a/lib/helpers.bash +++ b/lib/helpers.bash @@ -61,7 +61,7 @@ function reload_plugins() { bash-it () { about 'Bash-it help and maintenance' - param '1: verb [one of: help | show | enable | disable | migrate | update | search | version | reload ] ' + param '1: verb [one of: help | show | enable | disable | migrate | update | search | version | reload ] ' param '2: component type [one of: alias(es) | completion(s) | plugin(s) ] or search term(s)' param '3: specific component [optional]' example '$ bash-it show plugins' @@ -79,28 +79,28 @@ bash-it () shift typeset func case $verb in - show) - func=_bash-it-$component;; - enable) - func=_enable-$component;; - disable) - func=_disable-$component;; - help) - func=_help-$component;; - search) - _bash-it-search $component "$@" - return;; - update) - func=_bash-it_update;; - migrate) - func=_bash-it-migrate;; - version) - func=_bash-it-version;; - reload) - func=_bash-it-reload;; - *) - reference bash-it - return;; + show) + func=_bash-it-$component;; + enable) + func=_enable-$component;; + disable) + func=_disable-$component;; + help) + func=_help-$component;; + search) + _bash-it-search $component "$@" + return;; + update) + func=_bash-it_update;; + migrate) + func=_bash-it-migrate;; + version) + func=_bash-it-version;; + reload) + func=_bash-it-reload;; + *) + reference bash-it + return;; esac # pluralize component if necessary @@ -270,7 +270,7 @@ _bash-it-reload() { source ~/.bashrc ;; esac - + cd - &> /dev/null || return } From f6e2fdd2cfd02931c9a4f491e710bced5e213912 Mon Sep 17 00:00:00 2001 From: Nils Winkler Date: Thu, 19 Jul 2018 09:00:02 +0200 Subject: [PATCH 22/30] Fixed reload command in the update function --- lib/helpers.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/helpers.bash b/lib/helpers.bash index f67ebea9..a2c0d3aa 100644 --- a/lib/helpers.bash +++ b/lib/helpers.bash @@ -187,7 +187,7 @@ _bash-it_update() { _bash-it-migrate echo "" echo "All done, enjoy!" - reload + bash-it reload else echo "Error updating Bash-it, please, check if your Bash-it installation folder (${BASH_IT}) is clean." fi From d00762d3cd63d41a0c7f4e978be62bf88dda3555 Mon Sep 17 00:00:00 2001 From: Raphael Parree Date: Thu, 26 Jul 2018 09:51:25 +0200 Subject: [PATCH 23/30] added minikube completion support --- completion/available/minikube.completion.bash | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 completion/available/minikube.completion.bash diff --git a/completion/available/minikube.completion.bash b/completion/available/minikube.completion.bash new file mode 100644 index 00000000..f1d19b87 --- /dev/null +++ b/completion/available/minikube.completion.bash @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +# minikube (Local Kubernetes) completion + +if command -v minikube &>/dev/null +then + eval "$(minikube completion bash)" +fi From f8473714472ba8c59e4e0b3e3d95bf78f31871c3 Mon Sep 17 00:00:00 2001 From: Enze Chi Date: Thu, 2 Aug 2018 21:46:20 +1000 Subject: [PATCH 24/30] Avoid double semicolon in the PROMPT_COMMAND The direnv bash hook already add a semicolon to the PROMPT_COMMAND and this plugin will add another one if direnv is installed. This commit will check if the PROMPT_COMMAND ends with semicolon to avoid have double ones. --- plugins/available/osx.plugin.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/available/osx.plugin.bash b/plugins/available/osx.plugin.bash index 2dba0279..0e74ab8d 100644 --- a/plugins/available/osx.plugin.bash +++ b/plugins/available/osx.plugin.bash @@ -5,7 +5,7 @@ about-plugin 'osx-specific functions' if [ $(uname) = "Darwin" ]; then if type update_terminal_cwd > /dev/null 2>&1 ; then if ! [[ $PROMPT_COMMAND =~ (^|;)update_terminal_cwd($|;) ]] ; then - PROMPT_COMMAND="$PROMPT_COMMAND;update_terminal_cwd" + PROMPT_COMMAND="${PROMPT_COMMAND%;};update_terminal_cwd" declared="$(declare -p PROMPT_COMMAND)" [[ "$declared" =~ \ -[aAilrtu]*x[aAilrtu]*\ ]] 2>/dev/null [[ $? -eq 0 ]] && export PROMPT_COMMAND From 0960c1b26c46631e7c83d06937aa66e375cd7cc8 Mon Sep 17 00:00:00 2001 From: Jeremy Mathevet Date: Sun, 5 Aug 2018 20:24:40 +0100 Subject: [PATCH 25/30] kubectl aliases --- aliases/available/kubectl.aliases.bash | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 aliases/available/kubectl.aliases.bash diff --git a/aliases/available/kubectl.aliases.bash b/aliases/available/kubectl.aliases.bash new file mode 100644 index 00000000..58670ce5 --- /dev/null +++ b/aliases/available/kubectl.aliases.bash @@ -0,0 +1,24 @@ +#!/bin/bash +# +# -binaryanomaly + +cite 'about-alias' +about-alias 'kubectl aliases' + +# set apt aliases +function _set_pkg_aliases() +{ + if [ -x $(which kubectl) ]; then + alias kc='kubectl' + alias kcgp='kubectl get pods' + alias kcgd='kubectl get deployments' + alias kcgn='kubectl get nodes' + alias kcdp='kubectl describe pod' + alias kcdd='kubectl describe deployment' + alias kcdn='kubectl describe node' + alias kcgpan='kubectl get pods --all-namespaces' + alias kcgdan='kubectl get deployments --all-namespaces' + fi +} + +_set_pkg_aliases From 681aa230d836c8a89fb2eec6c645f4f14cbdc42f Mon Sep 17 00:00:00 2001 From: Cody Horst Date: Tue, 14 Aug 2018 20:40:28 -0700 Subject: [PATCH 26/30] add support for conda --- themes/zork/zork.theme.bash | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/themes/zork/zork.theme.bash b/themes/zork/zork.theme.bash index 75bc17d6..07f30e12 100644 --- a/themes/zork/zork.theme.bash +++ b/themes/zork/zork.theme.bash @@ -57,7 +57,12 @@ chroot(){ # show virtualenvwrapper my_ve(){ - if [ -n "$VIRTUAL_ENV" ] + + if [ -n "$CONDA_DEFAULT_ENV" ] + then + my_ps_ve="${bold_purple}${CONDA_DEFAULT_ENV}${normal}"; + echo "($my_ps_ve)"; + elif [ -n "$VIRTUAL_ENV" ] then my_ps_ve="${bold_purple}$ve${normal}"; echo "($my_ps_ve)"; From 52945d37c2fae4761ee15036360a76101e44ebfd Mon Sep 17 00:00:00 2001 From: Semyon Gashchenko Date: Sun, 26 Aug 2018 00:11:23 +0300 Subject: [PATCH 27/30] Add mvn package aliases --- aliases/available/maven.aliases.bash | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aliases/available/maven.aliases.bash b/aliases/available/maven.aliases.bash index 4cd89d27..f8a44a1c 100644 --- a/aliases/available/maven.aliases.bash +++ b/aliases/available/maven.aliases.bash @@ -3,9 +3,12 @@ about-alias 'maven abbreviations' alias mci='mvn clean install' alias mi='mvn install' +alias mcp='mvn clean package' +alias mp='mvn package' alias mrprep='mvn release:prepare' alias mrperf='mvn release:perform' alias mrrb='mvn release:rollback' alias mdep='mvn dependency:tree' alias mpom='mvn help:effective-pom' alias mcisk='mci -Dmaven.test.skip=true' +alias mcpsk='mcp -Dmaven.test.skip=true' From ac5a8aca47f42c6feab6bde3fb7e5a06d53f28ff Mon Sep 17 00:00:00 2001 From: Rutger Lubbers Date: Mon, 27 Aug 2018 12:32:12 +0200 Subject: [PATCH 28/30] Added completion of installable versions The versions that can be installed were not completed. The list of available versions showed the installed versions. The function retrieves the available versions and removes the already installed versions. --- completion/available/sdkman.completion.bash | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/completion/available/sdkman.completion.bash b/completion/available/sdkman.completion.bash index f5af6c6a..b4d62da1 100644 --- a/completion/available/sdkman.completion.bash +++ b/completion/available/sdkman.completion.bash @@ -27,10 +27,14 @@ _sdkman_complete() esac elif [ $COMP_CWORD -eq 3 ]; then case "${COMP_WORDS[COMP_CWORD-2]}" in - "install" | "uninstall" | "rm" | "use" | "default" ) + "uninstall" | "rm" | "use" | "default" ) _sdkman_candidate_versions ${COMP_WORDS[COMP_CWORD-1]} COMPREPLY=( $(compgen -W "$CANDIDATE_VERSIONS" -- ${COMP_WORDS[COMP_CWORD]}) ) ;; + "install") + _sdkman_candidate_not_installed_versions ${COMP_WORDS[COMP_CWORD-1]} + COMPREPLY=( $(compgen -W "$CANDIDATE_VERSIONS" -- ${COMP_WORDS[COMP_CWORD]}) ) + ;; *) ;; esac @@ -51,6 +55,14 @@ _sdkman_candidate_versions(){ } +_sdkman_candidate_not_installed_versions(){ + CANDIDATE_LOCAL_VERSIONS=$(__sdkman_cleanup_local_versions $1) + if [ "$SDKMAN_OFFLINE_MODE" = "false" ]; then + CANDIDATE_ONLINE_VERSIONS="$(__sdkman_list_versions $1 | grep " " | grep "\." | cut -c 6-)" + CANDIDATE_VERSIONS="$(echo $CANDIDATE_ONLINE_VERSIONS $CANDIDATE_LOCAL_VERSIONS | tr ' ' '\n' | sort | uniq -u) " + fi +} + __sdkman_cleanup_local_versions(){ __sdkman_build_version_csv $1 | tr ',' ' ' From c5e8349f698e36ed28265e9c4e6b485a0ed17322 Mon Sep 17 00:00:00 2001 From: Ahmad Assaf Date: Wed, 29 Aug 2018 15:00:46 +0100 Subject: [PATCH 29/30] Fixing Error when starting Terminal after installing Bash-IT --- completion/available/system.completion.bash | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/completion/available/system.completion.bash b/completion/available/system.completion.bash index b044627c..f9a3b29f 100644 --- a/completion/available/system.completion.bash +++ b/completion/available/system.completion.bash @@ -20,8 +20,8 @@ if [ $(uname) = "Darwin" ] && command -v brew &>/dev/null ; then . "$BREW_PREFIX"/etc/bash_completion fi - # homebrew/versions/bash-completion2 (required for projects.completion.bash) is installed to this path - if [ -f "$BREW_PREFIX"/share/bash-completion/bash_completion ]; then + # homebrew/versions/bash-completion2 (required for projects.completion.bash) is installed to this path + if [ "${BASH_VERSINFO}" -ge 4 ] && [ -f "$BREW_PREFIX"/share/bash-completion/bash_completion ]; then . "$BREW_PREFIX"/share/bash-completion/bash_completion fi fi From bdc31aa55d9a4803fbf6d5efad27735a1f0da6ac Mon Sep 17 00:00:00 2001 From: Claudia Date: Tue, 4 Sep 2018 07:25:28 +0200 Subject: [PATCH 30/30] Remove alias for `brew cask search` In Homebrew (the upstream project), `brew cask search` was merged into `brew search` a few months ago [1]. On 2018-09-30, `brew cask search` will be disabled altogether [2]. Since the output of `brew cask search` used to be subject to change at any time and was never meant to be parsed, scripts should not rely on the `bcsr` alias. So I figure it may not hurt to remove the `bcsr` alias from Bash-it before that deadline. [1]: https://github.com/Homebrew/brew/pull/4316 [2]: https://github.com/Homebrew/brew/commit/990dd7de865ccbbc0d0ef5fb62256a86f1c92133 --- aliases/available/homebrew-cask.aliases.bash | 1 - 1 file changed, 1 deletion(-) diff --git a/aliases/available/homebrew-cask.aliases.bash b/aliases/available/homebrew-cask.aliases.bash index 090622b0..57d8161c 100644 --- a/aliases/available/homebrew-cask.aliases.bash +++ b/aliases/available/homebrew-cask.aliases.bash @@ -7,7 +7,6 @@ alias bcin='brew cask install' alias bcrm='brew cask uninstall' alias bczp='brew cask zap' alias bccl='brew cask cleanup' -alias bcsr='brew cask search' alias bcls='brew cask list' alias bcinf='brew cask info' alias bcdr='brew cask doctor'