Skip to content

Commit

Permalink
Better imagePath comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
waTeim committed Jun 26, 2015
1 parent 30412bc commit a540255
Showing 1 changed file with 4 additions and 16 deletions.
20 changes: 4 additions & 16 deletions contrib/julia-config.jl
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,9 @@ function includeDir()
joinpath(match(r"(.*)(bin)",JULIA_HOME).captures[1],"include","julia");
end

function osxInitDir()
if imagePath()[end-1:end] == "ji"
return match(r"(.*)(/julia/sys.ji)",imagePath()).captures[1];
else
return match(r"(.*)(/julia/sys.dylib)",imagePath()).captures[1];
end
end

function linuxInitDir()
if imagePath()[end-1:end] == "ji"
return match(r"(.*)(/julia/sys.ji)",imagePath()).captures[1];
else
return match(r"(.*)(/julia/sys.so)",imagePath()).captures[1];
end
function unixInitDir()
filePart = split(imagePath(),"/")[end]
return match(Regex("(.*)(/julia/$filePart)"),imagePath()).captures[1];
end

function windowsInitDir()
Expand All @@ -46,8 +35,7 @@ function windowsInitDir()
end

function initDir()
@osx_only return osxInitDir();
@linux_only return linuxInitDir();
@unix_only return unixInitDir();
@windows_only return windowInitDir();
end

Expand Down

0 comments on commit a540255

Please sign in to comment.