Menu

#28 foreach fails with empty path

closed
nobody
None
5
2003-10-02
2003-04-17
No

I'm trying to do bundle up some files, if they exist. So I create a
path with include="**/CDM/*.sql" and iterate with foreach on
that path.

This works fine if there is at least one file matching that pattern.
But if there is no such file I get:
You must have a list or path to iterate through
and the build fails.

This behavior seems non-intuitive. It seems to me like foreach
should just do nothing if there is nothing in its list or path. It
should just be an empty iterator.

Discussion

  • Nobody/Anonymous

    Logged In: NO

    me too. please? it's just one line, i saw it....

     
  • bunnyhero

    bunnyhero - 2003-06-05

    Logged In: YES
    user_id=688434

    I would like to vote for this bug too. Having it fail with
    an error on an empty list is definitely broken, non-useful
    behavior.

     
  • Nobody/Anonymous

    Logged In: NO

    Have same problem - iterater that can't cope with zero iterations is a pain.

     
  • Michael Hirsch

    Michael Hirsch - 2003-07-27

    Logged In: YES
    user_id=28486

    This was entered as Feature Request 727207
    <https://sourceforge.net/tracker/index.php?func=detail&aid=727207&group_id=36177&atid=416923>

     
  • Matt Inger

    Matt Inger - 2003-10-02
    • status: open --> closed
     
  • Matt Inger

    Matt Inger - 2003-10-02

    Logged In: YES
    user_id=83032

    This is no longer an issue

     

Log in to post a comment.