Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix tildes in --project argument #31932

Merged
merged 6 commits into from
Jun 4, 2019
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion base/initdefs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ function init_load_path()
HOME_PROJECT[] =
project === nothing ? nothing :
project == "" ? nothing :
project == "@." ? current_project() : abspath(project)
project == "@." ? current_project() : abspath(expanduser(project))
append!(empty!(LOAD_PATH), paths)
end

Expand Down
5 changes: 0 additions & 5 deletions src/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -627,11 +627,6 @@ 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, "@.") != 0
&& strcmp(jl_options.project, "@") != 0
&& strcmp(jl_options.project, "") != 0)
jl_options.project = abspath(jl_options.project, 0);
if (jl_options.output_code_coverage)
jl_options.output_code_coverage = absformat(jl_options.output_code_coverage);

Expand Down
8 changes: 8 additions & 0 deletions test/cmdlineargs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,14 @@ let exename = `$(Base.julia_cmd()) --startup-file=no`
@test startswith(read(`$exename --help`, String), header)
end

# --project
Moelf marked this conversation as resolved.
Show resolved Hide resolved
let expanded = abspath(expanduser("~/foo"))
Moelf marked this conversation as resolved.
Show resolved Hide resolved
if(!Sys.iswindows())
Moelf marked this conversation as resolved.
Show resolved Hide resolved
@test occursin(expanded, readchomp(`$exename --project='~/foo' -E 'Base.active_project()'`))
Moelf marked this conversation as resolved.
Show resolved Hide resolved
@test occursin(expanded, readchomp(setenv(`$exename -E 'Base.active_project()'`, "JULIA_PROJECT"=>"~/foo")))
Moelf marked this conversation as resolved.
Show resolved Hide resolved
end
Moelf marked this conversation as resolved.
Show resolved Hide resolved
end

# --quiet, --banner
let t(q,b) = "Base.JLOptions().quiet == $q && Base.JLOptions().banner == $b"
@test success(`$exename -e $(t(0, -1))`)
Expand Down