Skip to content

Commit

Permalink
Merge pull request #70 from fingolfin/mh/reduce-diffs-release-1.1
Browse files Browse the repository at this point in the history
Reduce diffs to other branches for release-1.1
  • Loading branch information
oxinabox committed Jun 6, 2023
2 parents 5a19cb7 + 281e8b2 commit 8c84ef5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/TestEnv.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ include("common.jl")
include("activate_do.jl")
include("activate_set.jl")

end
end
2 changes: 1 addition & 1 deletion src/activate_do.jl
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ function activate(f, pkg::AbstractString=current_pkg_name())
Pkg.activate(ctx.env.project_file)
end
end
end
end
11 changes: 7 additions & 4 deletions src/common.jl
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ end

"""
ctx, pkgspec = ctx_and_pkgspec(pkg::AbstractString)
For a given package name `pkg`, instantiate a `Context` for it, and return that `Context`,
and it's `PackageSpec`.
"""
Expand Down Expand Up @@ -47,14 +47,17 @@ function isinstalled!(ctx::Context, pkgspec::Pkg.Types.PackageSpec)
return true
end


function test_dir_has_project_file(ctx, pkgspec)
return isfile(joinpath(get_test_dir(ctx, pkgspec), "Project.toml"))
test_dir = get_test_dir(ctx, pkgspec)
test_dir === nothing && return false
return isfile(joinpath(test_dir, "Project.toml"))
end

"""
get_test_dir(ctx::Context, pkgspec::Pkg.Types.PackageSpec)
Gets the testfile path of the package. Code for each Julia version mirrors that found
Gets the testfile path of the package. Code for each Julia version mirrors that found
in `Pkg/src/Operations.jl`.
"""
function get_test_dir(ctx::Context, pkgspec::Pkg.Types.PackageSpec)
Expand All @@ -74,4 +77,4 @@ function get_test_dir(ctx::Context, pkgspec::Pkg.Types.PackageSpec)
throw(TestEnvError("Could not find either `git-tree-sha1` or `path` for package $(pkgspec.name)"))
end
end
end
end

0 comments on commit 8c84ef5

Please sign in to comment.