Skip to content

Commit

Permalink
check apple first to avoid is_bsd matching and using xdg-open (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
KristofferC authored Oct 15, 2017
1 parent a922a80 commit df29875
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/tikzdocument.jl
Original file line number Diff line number Diff line change
Expand Up @@ -252,15 +252,15 @@ function Base.show(io::IO, ::MIME"text/plain", p::_SHOWABLE)
f = tempname() .* ".pdf"
save(f, p)
try
if is_linux() || is_bsd()
if is_apple()
run(`open $f`)
elseif is_linux() || is_bsd()
run(`xdg-open $f`)
elseif is_windows()
run(`start $f`)
elseif is_apple()
run(`open $f`)
end
catch e
error("Failed to show the generated pdf, run `PGFPlotsX.enable_interactive(false) to stop trying to show pdfs.`")
error("Failed to show the generated pdf, run `PGFPlotsX.enable_interactive(false)` to stop trying to show pdfs.\n", "Error: ", sprint(Base.showerror, e))
end
else
print(io, p)
Expand Down

0 comments on commit df29875

Please sign in to comment.