[erlang-questions] Excludes from ERL_LIBS

Per Melin per.melin@REDACTED
Wed Sep 5 01:17:56 CEST 2012

On Sep 4, 2012, at 17:38 , Uwe Dauernheim wrote:

> I have a project which has the directory structure of an OTP release (lib/*/{src,ebin}), but the project is not yet fully OTP'fied. I use ERL_LIBS to specify the location of all application. But now I want to exclude on application from being loaded. What would be the cleanest/easiest way to do this?

I'm not sure what you mean by excluding the app from being *loaded*. If you're saying that you have ERL_LIBS=lib and you want to exclude one application from the code path you can take advantage of the fact that ERL_LIBS can be a list of directories separated by colon (or semicolon on Windows).

This could be prettier, but you get the idea:
ERL_LIBS=$(ls -d lib/* | grep -v '/APP_TO_EXCLUDE$' | tr '\n' ':')

More information about the erlang-questions mailing list