Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion bash_it.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
#!/usr/bin/env bash
# shellcheck source-path=SCRIPTDIR/lib source-path=SCRIPTDIR/scripts
# shellcheck disable=SC2034
#

# Requires bash 3.2+ to install and run
# Skip loading if bash version is too old
if [[ "${BASH_VERSINFO[0]-}" -lt 3 ]] || [[ "${BASH_VERSINFO[0]-}" -eq 3 && "${BASH_VERSINFO[1]}" -lt 2 ]]; then
echo "sorry, but the minimum version of BASH supported by bash_it is 3.2, consider upgrading?" >&2
return 1
fi

# Initialize Bash It
BASH_IT_LOG_PREFIX="core: main: "
: "${BASH_IT:=${BASH_SOURCE%/*}}"
Expand Down
7 changes: 7 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
#!/usr/bin/env bash
# bash-it installer

# Requires bash 3.2+ to install and run
# Skip loading if bash version is too old
if [[ "${BASH_VERSINFO[0]-}" -lt 3 ]] || [[ "${BASH_VERSINFO[0]-}" -eq 3 && "${BASH_VERSINFO[1]}" -lt 2 ]]; then
echo "sorry, but the minimum version of BASH supported by bash_it is 3.2, consider upgrading?" >&2
return 1
fi

# Show how to use this installer
function _bash-it-install-help() {
echo -e "\n$0 : Install bash-it"
Expand Down
4 changes: 3 additions & 1 deletion plugins/available/history-eternal.plugin.bash
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ about-plugin 'eternal bash history'

if [[ ${BASH_VERSINFO[0]} -lt 4 ]] || [[ ${BASH_VERSINFO[0]} -eq 4 && ${BASH_VERSINFO[1]} -lt 3 ]]; then
_log_warning "Bash version 4.3 introduced the 'unlimited' history size capability."
return 1
_log_warning "Disabling history-eternal plugin (current version: $BASH_VERSION)"
_disable-plugin history-eternal
return 0
fi

# Modify history sizes before changing location to avoid unintentionally
Expand Down
7 changes: 7 additions & 0 deletions plugins/available/pack.plugin.bash
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# shellcheck shell=bash
# bash completion for pack -*- shell-script -*-

# Requires bash 3.3+ for associative arrays
# Skip loading if bash version is too old
if [[ -n "${BASH_VERSINFO[0]}" ]] && [[ "${BASH_VERSINFO[0]}" -eq 3 ]] && [[ "${BASH_VERSINFO[1]}" -lt 3 ]]; then
_disable-plugin pack
return 0
fi

cite about-plugin
about-plugin 'CNB pack cli aliases'

Expand Down
5 changes: 3 additions & 2 deletions plugins/available/percol.plugin.bash
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ _command_exists percol || return

if [[ ${BASH_VERSINFO[0]} -lt 4 ]]; then
_log_warning "You have to upgrade Bash to Bash v4.x to use the 'percol' plugin."
_log_warning "Your current Bash version is $BASH_VERSION."
return
_log_warning "Disabling percol plugin (current version: $BASH_VERSION)"
_disable-plugin percol
return 0
fi

function _replace_by_history() {
Expand Down
Loading