testing
This commit is contained in:
parent
f483bf1ab1
commit
a29ee9784c
1 changed files with 31 additions and 19 deletions
50
test.sh
50
test.sh
|
@ -65,12 +65,8 @@ spin-get-dependencies() {
|
|||
done
|
||||
|
||||
pkglist=()
|
||||
|
||||
pkglist+="$(printf "%s\n" "${deplist[@]}")"
|
||||
# pkglist=()
|
||||
# pkglist="${deplist[*]}"
|
||||
|
||||
check "pkglist: ${pkglist[*]}"
|
||||
line
|
||||
;;
|
||||
*)
|
||||
echo_error "There are no dependencies to install for $distro"
|
||||
|
@ -79,6 +75,25 @@ spin-get-dependencies() {
|
|||
esac
|
||||
}
|
||||
|
||||
spin-installation() {
|
||||
local pkglist="$@"
|
||||
local pkg err out
|
||||
line
|
||||
pen bold green "Starting installation now.."
|
||||
for pkg in "${pkglist[@]}"; 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() {
|
||||
|
@ -89,20 +104,17 @@ main() {
|
|||
else
|
||||
check "Dependency list generated!"
|
||||
|
||||
spin bold yellow "Installing packagelist.. ${pkglist[*]}"
|
||||
sleep 3
|
||||
|
||||
for pkg in "${pkglist[@]}"; do
|
||||
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
|
||||
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
|
||||
|
||||
# case "$distro" in
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue