mirror of
https://github.com/ChrisTitusTech/mybash.git
synced 2026-04-03 11:08:28 +00:00
Added CheckEnv for package manager. Tar and neovim are needed.
This commit is contained in:
committed by
GitHub
parent
1117869e97
commit
8853a0f85a
9
.bashrc
9
.bashrc
@@ -601,4 +601,11 @@ eval "$(starship init bash)"
|
||||
|
||||
#Autojump
|
||||
|
||||
. /usr/share/autojump/autojump.sh
|
||||
if [ -f "/usr/share/autojump/autojump.sh" ]; then
|
||||
. /usr/share/autojump/autojump.sh
|
||||
elif [ -f "/usr/share/autojump/autojump.bash" ]; then
|
||||
. /usr/share/autojump/autojump.bash
|
||||
else
|
||||
echo "can't found the autojump script"
|
||||
fi
|
||||
|
||||
|
||||
14
setup.sh
14
setup.sh
@@ -14,7 +14,7 @@ checkEnv(){
|
||||
fi
|
||||
|
||||
## Check for requirements.
|
||||
REQUIREMENTS='curl apt groups sudo'
|
||||
REQUIREMENTS='curl groups sudo'
|
||||
if ! which ${REQUIREMENTS}>/dev/null;then
|
||||
echo -e "${RED}To run me, you need: ${REQUIREMENTS}${RC}"
|
||||
exit 1
|
||||
@@ -25,20 +25,24 @@ checkEnv(){
|
||||
echo -e "${RED}You need to be a member of the sudo group to run me!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ ! -x "/usr/bin/apt-get" ]] || [[ ! -x "/usr/bin/yum" ]]; then
|
||||
echo -e "Can't find a supported package manager"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
installDepend(){
|
||||
## Check for dependencies.
|
||||
DEPENDENCIES='autojump bash bash-completion'
|
||||
DEPENDENCIES='autojump bash bash-completion tar neovim'
|
||||
echo -e "${YELLOW}Installing dependencies...${RC}"
|
||||
if [[ -x "/usr/bin/apt-get" ]]; then
|
||||
sudo dpkg --configure -a
|
||||
sudo apt-get install -fyq ${DEPENDENCIES}
|
||||
sudo dpkg --configure -a
|
||||
elif [[ -x "/usr/bin/yum" ]]; then
|
||||
sudo yum install -fyq ${DEPENDENCIES}
|
||||
else
|
||||
echo "Can't check the package manager to use"
|
||||
sudo yum install -yq ${DEPENDENCIES}
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user