Skip to content

Commit c1fee0e

Browse files
authored
fix relative paths in Apps for dev (#4481)
1 parent e6b1d0b commit c1fee0e

File tree

2 files changed

+23
-11
lines changed

2 files changed

+23
-11
lines changed

src/Apps/Apps.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ end
231231

232232
function develop(pkg::PackageSpec)
233233
if pkg.path !== nothing
234-
pkg.path == abspath(pkg.path)
234+
pkg.path = abspath(pkg.path)
235235
end
236236
handle_package_input!(pkg)
237237
ctx = app_context()

test/apps.jl

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -94,18 +94,30 @@ using Test
9494
@test Sys.which(flagsexename) == nothing
9595
end
9696

97-
# https://github.com/JuliaLang/Pkg.jl/issues/4258
98-
Pkg.Apps.add(path = path)
99-
Pkg.Apps.develop(path = path)
97+
# Test both absolute path and relative path "." work for develop
98+
# https://github.com/JuliaLang/Pkg.jl/issues/4258 and #4480
99+
for test_path in [path, "."]
100+
if test_path == "."
101+
cd(path) do
102+
Pkg.Apps.develop(path = test_path)
103+
end
104+
else
105+
Pkg.Apps.develop(path = test_path)
106+
end
100107

101-
# Verify that dev does not create an app environment directory
102-
app_env_dir = joinpath(first(DEPOT_PATH), "environments", "apps", "Rot13")
103-
@test !isdir(app_env_dir)
108+
# Verify that dev does not create an app environment directory
109+
app_env_dir = joinpath(first(DEPOT_PATH), "environments", "apps", "Rot13")
110+
@test !isdir(app_env_dir)
104111

105-
# Verify that changes to the dev'd package are immediately reflected
106-
mv(joinpath(path, "src", "Rot13_edited.jl"), joinpath(path, "src", "Rot13.jl"); force = true)
107-
withenv("PATH" => string(joinpath(first(DEPOT_PATH), "bin"), sep, current_path)) do
108-
@test read(`$exename test`, String) == "Updated!\n"
112+
# Verify that changes to the dev'd package are immediately reflected (only test once)
113+
if test_path == path
114+
mv(joinpath(path, "src", "Rot13_edited.jl"), joinpath(path, "src", "Rot13.jl"); force = true)
115+
withenv("PATH" => string(joinpath(first(DEPOT_PATH), "bin"), sep, current_path)) do
116+
@test read(`$exename test`, String) == "Updated!\n"
117+
end
118+
end
119+
120+
Pkg.Apps.rm("Rot13")
109121
end
110122
end
111123
end

0 commit comments

Comments
 (0)