Skip to content

Commit

Permalink
track_scratch_access: fix a corner case when trying to look up (#13)
Browse files Browse the repository at this point in the history
the project file for a loaded package that is not reachable
any longer and thus Base.pathof(m) returns nothing.
  • Loading branch information
fredrikekre authored Sep 4, 2020
1 parent a49806f commit 5677106
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "Scratch"
uuid = "6c6a2e73-6563-6170-7368-637461726353"
authors = ["Elliot Saba <[email protected]>"]
version = "1.0.0"
version = "1.0.1"

[deps]
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
Expand Down
4 changes: 3 additions & 1 deletion src/Scratch.jl
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,9 @@ function track_scratch_access(pkg_uuid::UUID, scratch_path::AbstractString)
for (p, m) in Base.loaded_modules
if p.uuid == pkg_uuid
source_path = Base.pathof(m)
return Base.current_project(dirname(source_path))
if source_path !== nothing
return Base.current_project(dirname(source_path))
end
end
end

Expand Down

2 comments on commit 5677106

@fredrikekre
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/20870

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v1.0.1 -m "<description of version>" 56771063045708ef8fc01ad8616db9edab06f3a7
git push origin v1.0.1

Please sign in to comment.