Wrap initcwd changes in an if to avoid errors on non-linux