update to support local dir

That is to say, it can work without a dir