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