testing
This commit is contained in:
parent
dfe0c9e6c1
commit
4cab6852da
1 changed files with 35 additions and 33 deletions
68
test.sh
68
test.sh
|
@ -1,4 +1,5 @@
|
|||
#!/usr/bin/env bash
|
||||
deplist=()
|
||||
|
||||
# ─< Check if the given command exists silently >─────────────────────────────────────────
|
||||
command_exists() {
|
||||
|
@ -39,7 +40,6 @@ spin-get-dependencies() {
|
|||
depsAlpine=(bash zsh curl git neofetch waybar wlogout)
|
||||
|
||||
# declare -A deplist
|
||||
deplist=()
|
||||
|
||||
declare -A deps=(
|
||||
[debian]="depsDebian"
|
||||
|
@ -64,8 +64,7 @@ spin-get-dependencies() {
|
|||
fi
|
||||
done
|
||||
|
||||
check "pkglist: ${pkglist[*]}"
|
||||
|
||||
check "pkglist: ${deplist[*]}"
|
||||
line
|
||||
|
||||
# pen red "$deplist"
|
||||
|
@ -75,7 +74,7 @@ spin-get-dependencies() {
|
|||
# pen bold grey "Dep: $dep"
|
||||
# done
|
||||
|
||||
spin-installation "${deplist[@]}"
|
||||
# spin-installation "${deplist[@]}"
|
||||
|
||||
# for pk in "${pkglist[@]}"; do
|
||||
# pen bold red "Pkg: $pk"
|
||||
|
@ -92,23 +91,23 @@ spin-get-dependencies() {
|
|||
esac
|
||||
}
|
||||
|
||||
spin-installation() {
|
||||
local err out
|
||||
local pkgs="$@"
|
||||
|
||||
for pkg in "${pkgs[@]}"; do
|
||||
spin bold yellow "Installing $pkg"
|
||||
if run --err err --out out pkg-install "$pkg"; then
|
||||
check "Installed $pkg"
|
||||
line
|
||||
else
|
||||
throw "$pkg could not get installed.."
|
||||
echo_error "${err:-}"
|
||||
echo_note "${out:-}"
|
||||
line
|
||||
fi
|
||||
done
|
||||
}
|
||||
# spin-installation() {
|
||||
# local err out
|
||||
# local pkgs="$@"
|
||||
#
|
||||
# for pkg in "${pkgs[@]}"; do
|
||||
# spin bold yellow "Installing $pkg"
|
||||
# if run --err err --out out pkg-install "$pkg"; then
|
||||
# check "Installed $pkg"
|
||||
# line
|
||||
# else
|
||||
# throw "$pkg could not get installed.."
|
||||
# echo_error "${err:-}"
|
||||
# echo_note "${out:-}"
|
||||
# line
|
||||
# fi
|
||||
# done
|
||||
# }
|
||||
|
||||
main() {
|
||||
local err out
|
||||
|
@ -119,19 +118,22 @@ main() {
|
|||
check "Dependency list generated!"
|
||||
pen red bold "There are ${#deplist[@]} items to install.."
|
||||
# local pkgs="$@"
|
||||
|
||||
for pkg in "${deplist[@]}"; do
|
||||
spin bold yellow "Installing $pkg"
|
||||
if run --err err --out out pkg-install "$pkg"; then
|
||||
check "Installed $pkg"
|
||||
line
|
||||
else
|
||||
check "$pkg could not get installed.."
|
||||
echo_error "${err:-}"
|
||||
echo_note "${out:-}"
|
||||
line
|
||||
fi
|
||||
for ((i = 0; i < "${#deplist[@]}"; i++)); do
|
||||
for pkg in "${deplist[@]}"; do
|
||||
spin bold yellow "Installing $pkg"
|
||||
if run --err err --out out pkg-install "$pkg"; then
|
||||
check "Installed $pkg"
|
||||
line
|
||||
else
|
||||
check "$pkg could not get installed.."
|
||||
echo_error "${err:-}"
|
||||
echo_note "${out:-}"
|
||||
line
|
||||
continue
|
||||
fi
|
||||
done
|
||||
done
|
||||
|
||||
fi
|
||||
|
||||
# case "$distro" in
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue