Due to changes in the way fish handles variable lookup the fish
autojump integration stopped working with fish version 2.3.
By exporting the needed variables globally it works also with fish 2.3.
OSTYPE was not being set correctly. It is in bash, not sh.
Since the value is unlikely to change, I read it once and
stored it globally
Test logic was backward in jo function, causing error to always
be printed, unless you did NOT specify a directory name.
I'm not sure if this is actually a bug in fish, but (test -d) with no argument returns true, and nonexistent environment variables return an empty string, so (test -d $XDG_DATA_HOME) returns true when $XDG_DATA_HOME isn't set.
Prior to making this change, I would get an error from dirname when opening a shell and an error from fish when cd'ing.