-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1938 from gaelicWizard/_command_exists
Use `_command_exists` everywhere
- Loading branch information
Showing
36 changed files
with
163 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,6 @@ | ||
[[ -x "$(which aws_completer)" ]] && complete -C "$(which aws_completer)" aws | ||
# shellcheck shell=bash | ||
|
||
if _command_exists aws_completer | ||
then | ||
complete -C "$(command -v aws_completer)" aws | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,17 @@ | ||
#!/usr/bin/bash | ||
|
||
if command -v laravel > /dev/null; then | ||
__laravel_completion() { | ||
if _command_exists laravel | ||
then | ||
function __laravel_completion() | ||
{ | ||
local OPTS=("-h --help -q --quiet --ansi --no-ansi -n --no-interaction -v -vv -vvv --verbose help list new") | ||
COMPREPLY=() | ||
for _opt_ in ${OPTS[@]}; do | ||
if [[ "$_opt_" == "$2"* ]]; then | ||
COMPREPLY+=("$_opt_") | ||
fi | ||
done | ||
} | ||
} | ||
|
||
complete -F __laravel_completion laravel | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,6 @@ | ||
[[ -x "$(which pew)" ]] && source "$(pew shell_config)" | ||
# shellcheck shell=bash | ||
|
||
if _command_exists pew | ||
then | ||
source "$(pew shell_config)" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,10 @@ | ||
if [[ -x "$(which travis)" ]]; then | ||
__TRAVIS_COMPLETION_SCRIPT="${TRAVIS_CONFIG_PATH:-${HOME}/.travis}/travis.sh" | ||
[[ -f "${__TRAVIS_COMPLETION_SCRIPT}" ]] && source "${__TRAVIS_COMPLETION_SCRIPT}" | ||
# shellcheck shell=bash | ||
|
||
if _command_exists travis | ||
then | ||
if [[ -s "${__TRAVIS_COMPLETION_SCRIPT:=${TRAVIS_CONFIG_PATH:-${HOME}/.travis}/travis.sh}" ]] | ||
then | ||
source "${__TRAVIS_COMPLETION_SCRIPT}" | ||
fi | ||
unset __TRAVIS_COMPLETION_SCRIPT | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,15 @@ | ||
# shellcheck shell=bash | ||
cite about-plugin | ||
about-plugin 'Autojump configuration, see https://github.com/wting/autojump for more details' | ||
|
||
# Only supports the Homebrew variant, Debian and Arch at the moment. | ||
# Feel free to provide a PR to support other install locations | ||
if _bash_it_homebrew_check && [[ -s "${BASH_IT_HOMEBREW_PREFIX}/etc/profile.d/autojump.sh" ]]; then | ||
. "${BASH_IT_HOMEBREW_PREFIX}/etc/profile.d/autojump.sh" | ||
elif command -v dpkg &>/dev/null && dpkg -s autojump &>/dev/null ; then | ||
. "$(dpkg-query -S autojump.sh | cut -d' ' -f2)" | ||
elif command -v pacman &>/dev/null && pacman -Q autojump &>/dev/null ; then | ||
. "$(pacman -Ql autojump | grep autojump.sh | cut -d' ' -f2)" | ||
source "${BASH_IT_HOMEBREW_PREFIX}/etc/profile.d/autojump.sh" | ||
elif _command_exists dpkg && dpkg -s autojump &> /dev/null; then | ||
# shellcheck disable=SC1090 | ||
source "$(dpkg-query -S autojump.sh | cut -d' ' -f2)" | ||
elif _command_exists pacman && pacman -Q autojump &> /dev/null; then | ||
# shellcheck disable=SC1090 | ||
source "$(pacman -Ql autojump | grep autojump.sh | cut -d' ' -f2)" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
# shellcheck shell=bash | ||
cite about-plugin | ||
about-plugin 'load direnv, if you are using it: https://direnv.net/' | ||
|
||
[ -x "$(which direnv)" ] && eval "$(direnv hook bash)" | ||
if _command_exists direnv; then | ||
eval "$(direnv hook bash)" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
# shellcheck shell=bash | ||
cite about-plugin | ||
about-plugin 'load hub, if you are using it' | ||
|
||
command -v hub &> /dev/null && eval "$(hub alias -s)" | ||
if _command_exists hub; then | ||
eval "$(hub alias -s)" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,12 @@ | ||
# shellcheck shell=bash | ||
# shellcheck disable=SC2016 | ||
cite about-plugin | ||
about-plugin 'initialize jump (see https://github.com/gsamokovarov/jump). Add `export JUMP_OPTS=("--bind=z")` to change keybinding' | ||
|
||
__init_jump() { | ||
command -v jump &> /dev/null || return | ||
eval "$(jump shell bash "${JUMP_OPTS[@]}")" | ||
function __init_jump() { | ||
if _command_exists jump; then | ||
eval "$(jump shell bash "${JUMP_OPTS[@]}")" | ||
fi | ||
} | ||
|
||
__init_jump |
Oops, something went wrong.