i'm trying find way dynamically build en environment variable contains list of jar files under app's web-inf/lib folder.
this have far, it's over-writing each time, when reach end of loop, have last file loop set in variable.
setlocal enabledelayedexpansion %%f in (web-inf/lib/*.jar) ( set jar_list=%jar_list%;%%f ) echo jar_list -- %jar_list%
so produces...
c:\apache\tomcat6.0\webapps\myapp>(set jar_list=.;xsltcbrazil.jar )
c:\apache\tomcat6.0\webapps\myapp>(set jar_list=.;xsltcejb.jar )
c:\apache\tomcat6.0\webapps\myapp>(set jar_list=.;xsltcservlet.jar )
c:\apache\tomcat6.0\webapps\myapp>echo jar_list -- .;xsltcservlet.jar
jar_list -- .;xsltcservlet.jar
change
set jar_list=%jar_list%;%%f
to
set jar_list=!jar_list!;%%f
this use run-time value instead of load-time value. might better avoid leading ;
setlocal enabledelayedexpansion set "jar_list=" %%f in (web-inf/lib/*.jar) ( if "!jar_list!"=="" (set jar_list=%%f) else (set jar_list=!jar_list!;%%f) ) echo jar_list -- %jar_list%
Comments
Post a Comment