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:
parent
1cfa858ac0
commit
a2ca937646
14
apt-cyg
14
apt-cyg
|
@ -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
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue