Handle generation with a different cwd properly.