Skip to content

Commit

Permalink
Absolutify path specified with --project.
Browse files Browse the repository at this point in the history
  • Loading branch information
fredrikekre committed Aug 14, 2018
1 parent d7e4584 commit c945090
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -592,6 +592,8 @@ static void jl_resolve_sysimg_location(JL_IMAGE_SEARCH rel)
jl_options.outputbc = abspath(jl_options.outputbc, 0);
if (jl_options.machine_file)
jl_options.machine_file = abspath(jl_options.machine_file, 0);
if (jl_options.project && strcmp(jl_options.project, "@."))
jl_options.project = abspath(jl_options.project, 0);

const char **cmdp = jl_options.cmds;
if (cmdp) {
Expand Down
13 changes: 13 additions & 0 deletions test/loading.jl
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,19 @@ finally
popfirst!(LOAD_PATH)
end

@testset "--project path should be absolutified" begin
mktempdir() do dir; cd(dir) do
mkdir("foo")
script = """
using Test
old = Base.active_project()
cd("foo")
@test Base.active_project() == old
"""
@test success(`$(Base.julia_cmd()) --project=foo -e $(script)`)
end; end
end

## cleanup after tests ##

for env in keys(envs)
Expand Down

0 comments on commit c945090

Please sign in to comment.