Skip to content

Commit e2144b5

Browse files
KristofferCKristofferC
authored andcommitted
fix dev taking when the app is already installed (#4259)
Co-authored-by: KristofferC <[email protected]> (cherry picked from commit a94a6bc)
1 parent b0add7c commit e2144b5

File tree

3 files changed

+17
-7
lines changed

3 files changed

+17
-7
lines changed

src/Apps/Apps.jl

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ function _resolve(manifest::Manifest, pkgname=nothing)
7878
end
7979

8080
projectfile = joinpath(app_env_folder(), pkg.name, "Project.toml")
81-
sourcepath = source_path(app_manifest_file(), pkg)
8281

8382
# TODO: Add support for existing manifest
8483
# Create a manifest with the manifest entry
@@ -87,12 +86,8 @@ function _resolve(manifest::Manifest, pkgname=nothing)
8786
if isempty(ctx.env.project.deps)
8887
ctx.env.project.deps[pkg.name] = uuid
8988
end
90-
if isempty(ctx.env.manifest)
91-
ctx.env.manifest.deps[uuid] = pkg
92-
Pkg.resolve(ctx)
93-
else
94-
Pkg.instantiate(ctx)
95-
end
89+
ctx.env.manifest.deps[uuid] = pkg
90+
Pkg.resolve(ctx)
9691
end
9792

9893
# TODO: Julia path

test/apps.jl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,14 @@ isolate(loaded_depot=true) do
3333
Pkg.Apps.rm("Rot13")
3434
@test Sys.which(exename) == nothing
3535
end
36+
37+
# https://github.com/JuliaLang/Pkg.jl/issues/4258
38+
Pkg.Apps.add(path=path)
39+
Pkg.Apps.develop(path=path)
40+
mv(joinpath(path, "src", "Rot13_edited.jl"), joinpath(path, "src", "Rot13.jl"); force=true)
41+
withenv("PATH" => string(joinpath(first(DEPOT_PATH), "bin"), sep, current_path)) do
42+
@test read(`$exename test`, String) == "Updated!\n"
43+
end
3644
end
3745
end
3846

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module Rot13
2+
3+
function (@main)(ARGS)
4+
println("Updated!")
5+
end
6+
7+
end # module Rot13

0 commit comments

Comments
 (0)