Refactor
This commit is contained in:
parent
d555a136f2
commit
7087bf42ef
|
@ -94,19 +94,15 @@ getGitconfigData() {
|
||||||
|
|
||||||
checkForDependencies() {
|
checkForDependencies() {
|
||||||
comm=$1 && [ "$1" = "libnewt" ] && comm=whiptail
|
comm=$1 && [ "$1" = "libnewt" ] && comm=whiptail
|
||||||
|
command -v "${comm}" &> /dev/null && return 0
|
||||||
|
|
||||||
command -v "${comm}" &> /dev/null
|
unameOutput=$(uname -a | grep -q "arch")
|
||||||
if [ $? -ne 0 ]; then
|
if [ -f "/etc/arch-release" ] || [ "$unameOutput" -ne 1 ]; then
|
||||||
unameOutput=$(uname -a | grep "arch")
|
sudo pacman --noconfirm --needed -Sy "${1}" && return 0
|
||||||
[ ! -f "/etc/arch-release" ] && [ "$unameOutput" -ne 0 ] && return 1
|
echo "Couldn't install ${1}. We will continue without it."
|
||||||
sudo pacman --noconfirm --needed -Sy "${1}"
|
|
||||||
if [ $? -eq 1 ]; then
|
|
||||||
echo "Couldn't install ${1}. We will continue without it."
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
setDialogBox "plain"
|
||||||
return 0
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
runUserScripts() {
|
runUserScripts() {
|
||||||
|
|
Loading…
Reference in New Issue