testing
This commit is contained in:
parent
e4953bc94e
commit
1180e7bece
1 changed files with 7 additions and 36 deletions
43
test.sh
43
test.sh
|
@ -60,13 +60,18 @@ spin-get-dependencies() {
|
||||||
debian | ubuntu | arch | fedora | alpine | opensuse)
|
debian | ubuntu | arch | fedora | alpine | opensuse)
|
||||||
for pkg in "${pkgArray[@]}"; do
|
for pkg in "${pkgArray[@]}"; do
|
||||||
if ! command_exists $pkg; then
|
if ! command_exists $pkg; then
|
||||||
deplist="$deplist $pkg"
|
deplist+=("$pkg ")
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
declare -n pkglist="${deplist[@]}"
|
pen red "$deplist"
|
||||||
|
pkglist="${deplist[@]}"
|
||||||
|
pen yellow "$pkglist"
|
||||||
|
|
||||||
check "pkglist: ${pkglist[*]}"
|
check "pkglist: ${pkglist[*]}"
|
||||||
line
|
line
|
||||||
|
|
||||||
|
exit 1
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo_error "There are no dependencies to install for $distro"
|
echo_error "There are no dependencies to install for $distro"
|
||||||
|
@ -75,28 +80,6 @@ spin-get-dependencies() {
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
spin-installation() {
|
|
||||||
local pkglists="$@"
|
|
||||||
local pkg err out
|
|
||||||
pen bold green "Starting installation now.."
|
|
||||||
line
|
|
||||||
|
|
||||||
for pkg in "${pkglists[@]}"; do
|
|
||||||
spin grey "Installing $pkg"
|
|
||||||
if run --err err --out out pkg-install $pkg; then
|
|
||||||
check green "$pkg installed!"
|
|
||||||
line
|
|
||||||
else
|
|
||||||
throw "$pkg was not installed!"
|
|
||||||
echo_error "${err:-}"
|
|
||||||
echo_note "${out:-}"
|
|
||||||
line
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
# echo default
|
|
||||||
|
|
||||||
main() {
|
main() {
|
||||||
local err
|
local err
|
||||||
|
|
||||||
|
@ -104,18 +87,6 @@ main() {
|
||||||
throw "Dependencies could not get generated!"
|
throw "Dependencies could not get generated!"
|
||||||
else
|
else
|
||||||
check "Dependency list generated!"
|
check "Dependency list generated!"
|
||||||
|
|
||||||
spin-installation "${pkglist[@]}"
|
|
||||||
# spin bold yellow "Installing $pkg"
|
|
||||||
# if run --err err pkg-install "$pkg"; then
|
|
||||||
# check "Installed $pkg!"
|
|
||||||
# line
|
|
||||||
# else
|
|
||||||
# throw "$(pen bold blue ${pkglist[*]}) could not get installed!"
|
|
||||||
# echo_error "${err:-}"
|
|
||||||
# line
|
|
||||||
# fi
|
|
||||||
# done
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# case "$distro" in
|
# case "$distro" in
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue