Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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 Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "BinaryBuilderBase"
uuid = "7f725544-6523-48cd-82d1-3fa08ff4056e"
authors = ["Elliot Saba <staticfloat@gmail.com>"]
version = "0.6.4"
version = "0.6.5"

[deps]
CodecZlib = "944b1d66-785c-5afd-91f1-9de20f533193"
Expand Down
9 changes: 5 additions & 4 deletions src/Prefix.jl
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,13 @@ function includedir(prefix::Prefix)
end

"""
logdir(prefix::Prefix)
logdir(prefix::Prefix; subdir::AbstractString="")

Returns the logs directory for the given `prefix`.
Returns the logs directory for the given `prefix`. If `subdir` is a non-empty string, that
directory it is appended to the logdir of the given `prefix`.
"""
function logdir(prefix::Prefix)
return joinpath(prefix, "logs")
function logdir(prefix::Prefix; subdir::AbstractString="")
return strip_backslash(joinpath(prefix, "logs", subdir))
Copy link
Member

Choose a reason for hiding this comment

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

Hilariously, strip_backslash() actually strips forward-slashes on Linux/macOS.

Copy link
Member Author

Choose a reason for hiding this comment

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

I think it's a misnomer 🤦

end

"""
Expand Down
2 changes: 1 addition & 1 deletion src/utils.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# The functions in this file may not be used anywhere in this package but may
# needed by different modules of BinaryBuilder.jl

with_logfile(f::Function, prefix::Prefix, name::String) = with_logfile(f, joinpath(logdir(prefix), name))
with_logfile(f::Function, prefix::Prefix, name::String; subdir="") = with_logfile(f, joinpath(logdir(prefix; subdir), name))
function with_logfile(f::Function, logfile::String)
mkpath(dirname(logfile))

Expand Down
1 change: 1 addition & 0 deletions test/prefix.jl
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ using CodecZlib
@test bindir(prefix) == joinpath(prefix, "bin")
@test includedir(prefix) == joinpath(prefix, "include")
@test logdir(prefix) == joinpath(prefix, "logs")
@test logdir(prefix; subdir="test") == joinpath(prefix, "logs", "test")
end
end

Expand Down