mirror of
https://github.com/ohmybash/oh-my-bash.git
synced 2024-05-11 05:55:37 +00:00
Fix to check bash version before install (#28)
* Fix to check bash version before install * Fix for non-zero exit status
This commit is contained in:
committed by
Toan Nguyen
parent
246d698e4c
commit
e66772ba24
@@ -134,6 +134,5 @@ if ! type_exists '__git_ps1' ; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Adding Support for other OSes
|
# Adding Support for other OSes
|
||||||
PREVIEW="less"
|
[ -s /usr/bin/gloobus-preview ] && PREVIEW="gloobus-preview" ||
|
||||||
[ -s /usr/bin/gloobus-preview ] && PREVIEW="gloobus-preview"
|
[ -s /Applications/Preview.app ] && PREVIEW="/Applications/Preview.app" || PREVIEW="less"
|
||||||
[ -s /Applications/Preview.app ] && PREVIEW="/Applications/Preview.app"
|
|
||||||
|
@@ -26,6 +26,17 @@ main() {
|
|||||||
# which may fail on systems lacking tput or terminfo
|
# which may fail on systems lacking tput or terminfo
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
# Checks the minium version of bash (v4) installed,
|
||||||
|
# stops the installation if check fails
|
||||||
|
if [ -n $BASH_VERSION ]; then
|
||||||
|
bash_major_version=$(echo $BASH_VERSION | cut -d '.' -f 1)
|
||||||
|
if [ "${bash_major_version}" -lt "4" ]; then
|
||||||
|
printf "Error: Bash 4 required for Oh My Bash.\n"
|
||||||
|
printf "Error: Upgrade Bash and try again.\n"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
if [ ! -n "$OSH" ]; then
|
if [ ! -n "$OSH" ]; then
|
||||||
OSH=$HOME/.oh-my-bash
|
OSH=$HOME/.oh-my-bash
|
||||||
fi
|
fi
|
||||||
|
Reference in New Issue
Block a user