Replace current dir line with a cross platform version