conditionally execute .resources()

I know that off of a .exec() you can do a doIf() which is wonderful, but I am having a hard time figuring out how to conditionally acquire resources with a call without repeating code. My use case is I want to have a config flag that will determine if our simulation interacts strictly with just our system or if the simulation will also pull accompanying resources located elsewhere. Is there a way to conditionally execute .resources()?