fix bash/zsh test, some cosmetics

This commit is contained in:
Geoffray Levasseur
2023-10-06 11:22:10 +02:00
parent 0d7c7e9ab7
commit 18f1bc1543

View File

@@ -35,7 +35,7 @@
# * OF SUCH DAMAGE. # * OF SUCH DAMAGE.
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
if [[ ! $(echo $SHELL | grep -e bash|zsh) ]]; then if [[ ! $SHELL =~ bash|zsh ]]; then
echo "That environmet script is designed to be used with bash or zsh being the shell." echo "That environmet script is designed to be used with bash or zsh being the shell."
echo "Please consider using bash or zsh instead, or patch me ;)!" echo "Please consider using bash or zsh instead, or patch me ;)!"
return 1 return 1
@@ -86,7 +86,7 @@ else
export MYPATH=$PROFILE_PATH export MYPATH=$PROFILE_PATH
fi fi
if [[ ! -e $MYPATH/profile.sh ]]; then if [[ ! -e $MYPATH/profile.sh ]]; then
echo "[ Warning ] Path detection failed, using pwd..." echo "[ Warning ] Path detection failed, trying to use pwd..."
MYPATH=$(pwd) MYPATH=$(pwd)
if [[ ! -e $MYPATH/profile.sh ]]; then if [[ ! -e $MYPATH/profile.sh ]]; then
echo "[ Error ] Impossible to determine installation path, pretty much nothing will work." echo "[ Error ] Impossible to determine installation path, pretty much nothing will work."
@@ -106,6 +106,10 @@ fi
[[ -d ~/bin ]] && pathappend ~/bin [[ -d ~/bin ]] && pathappend ~/bin
[[ -d ~/.local/bin ]] && pathappend ~/.local/bin [[ -d ~/.local/bin ]] && pathappend ~/.local/bin
# ------------------------------------------------------------------------------
# Default values are set here and will be overloaded with config file if any
# ------------------------------------------------------------------------------
# Set bash history # Set bash history
export HISTSIZE=50000 export HISTSIZE=50000
export HISTIGNORE="&:[bf]g:exit" export HISTIGNORE="&:[bf]g:exit"