testing
This commit is contained in:
parent
53228ddbb9
commit
c7e49404ea
1 changed files with 19 additions and 13 deletions
30
hyprutils.sh
30
hyprutils.sh
|
@ -7,6 +7,12 @@ command_exists() {
|
||||||
command -v "$@" >/dev/null 2>&1
|
command -v "$@" >/dev/null 2>&1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if command_exists $PACKAGE; then
|
||||||
|
echo_warning "$PACKAGE is alread installed!"
|
||||||
|
echo_warning "Exiting now!"
|
||||||
|
exit 69
|
||||||
|
fi
|
||||||
|
|
||||||
# WHY:
|
# WHY:
|
||||||
# This import will give you the following variables:
|
# This import will give you the following variables:
|
||||||
# _sudo="sudo -E" <- only if non root user
|
# _sudo="sudo -E" <- only if non root user
|
||||||
|
@ -65,13 +71,11 @@ getDependencies() {
|
||||||
# ╰────────────────────────────────────────────────────────────────╯
|
# ╰────────────────────────────────────────────────────────────────╯
|
||||||
declare -n pkgArray="${deps[$distro]}"
|
declare -n pkgArray="${deps[$distro]}"
|
||||||
|
|
||||||
case "$distro" in
|
if checkComp; then
|
||||||
debian) checkAndInstall "${pkgArray[@]}" ;;
|
for pkg in "${pkgArray[@]}"; do
|
||||||
*)
|
checkAndInstall "$pkg"
|
||||||
echo_error "There are no dependencies to install for $distro"
|
done
|
||||||
return 69
|
fi
|
||||||
;;
|
|
||||||
esac
|
|
||||||
}
|
}
|
||||||
|
|
||||||
build() {
|
build() {
|
||||||
|
@ -81,8 +85,8 @@ build() {
|
||||||
}
|
}
|
||||||
|
|
||||||
cloneAndInstall() {
|
cloneAndInstall() {
|
||||||
# local cloneDir="$(mktemp -d)"
|
local cloneDir="$(mktemp -d)"
|
||||||
local cloneDir="$HOME/.builds"
|
# local cloneDir="$HOME/.builds"
|
||||||
|
|
||||||
cd $cloneDir || mkdir -p $cloneDir && cd $cloneDir
|
cd $cloneDir || mkdir -p $cloneDir && cd $cloneDir
|
||||||
|
|
||||||
|
@ -110,10 +114,12 @@ main() {
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
if ! $arch || ! $debian; then
|
checkComp() {
|
||||||
echo_error "Your distro $distro is not supported by this script!"
|
if ! $arch && ! $debian; then
|
||||||
exit 69
|
echo_error "Your distro $distro is not compatible with this script"
|
||||||
|
return 69
|
||||||
fi
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
if getImports; then
|
if getImports; then
|
||||||
silent=false
|
silent=false
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue