Skip to content

Commit b3cee81

Browse files
tkelmansbromberger
authored andcommitted
use @__DIR__ instead of Pkg.dir (#47)
* use @__DIR__ instead of Pkg.dir this allows installing and loading the package from elsewhere * change Pkg.dir to @__DIR__ in runtests.jl * use dirname(@__DIR__) instead of Pkg.dir in GraphPlot.jl
1 parent 0e53be6 commit b3cee81

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/GraphPlot.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ include("plot.jl")
3232
include("graphio.jl")
3333

3434
function test()
35-
include(joinpath(Pkg.dir("GraphPlot"), "test", "runtests.jl"))
35+
include(joinpath(dirname(@__DIR__), "test", "runtests.jl"))
3636
end
3737

3838

src/graphio.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ a graph
1414
julia> g = graphfamous("karate")
1515
"""
1616
function graphfamous(graphname::AbstractString)
17-
file = joinpath(Pkg.dir("GraphPlot"), "data", graphname*".dat")
17+
file = joinpath(dirname(@__DIR__), "data", graphname*".dat")
1818
readedgelist(file)
1919
end
2020

test/runtests.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ h = LightGraphs.WheelGraph(10)
1010
nodelabel = collect(1:nv(g))
1111
nodesize = outdegree(g) .* 1.0
1212

13-
cachedout = joinpath(Pkg.dir("GraphPlot"), "test", "examples")
13+
cachedout = joinpath(@__DIR__, "examples")
1414

1515
@testset "Undirected Karate Net" begin
1616
filename = joinpath(cachedout, "karate_different_nodesize.svg")

0 commit comments

Comments
 (0)