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