Chdir to the inferred dir