Update checkpackages function

This function doesnt really need to exit, because package loops with no
packages will simply exit the loop immediately. Also by removing the "exit" it
allows to do cool stuff like

    if checkpackages
This commit is contained in:
Steven Penny 2014-05-05 01:46:58 -05:00
parent 1cfa858ac0
commit a2ca937646
1 changed files with 8 additions and 6 deletions

14
apt-cyg
View File

@ -122,10 +122,12 @@ function getsetup()
function checkpackages() function checkpackages()
{ {
if (( ! ${#packages} )) if (( ${#packages} ))
then then
echo Nothing to do, exiting return 0
exit else
echo Nothing to do.
return 1
fi fi
} }
@ -220,7 +222,7 @@ case "$command" in
;; ;;
list) list)
if (( ${#packages} )) if checkpackages
then then
findworkspace findworkspace
for pkg in $packages for pkg in $packages
@ -254,8 +256,8 @@ case "$command" in
;; ;;
show) show)
checkpackages
findworkspace findworkspace
checkpackages
for pkg in $packages for pkg in $packages
do do
echo echo
@ -324,8 +326,8 @@ case "$command" in
;; ;;
install) install)
checkpackages
findworkspace findworkspace
checkpackages
for pkg in $packages for pkg in $packages
do do