Allow path option to be a function