-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: run! errors if output is a standalone file #4
Conversation
Right now the `run!` function errors on the README instructions. The idea here is to add an `if` to check it the `dirname` of the `joinpath(pwd(), output)` is a dir instead of throwing error straight away.
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #4 +/- ##
==========================================
- Coverage 83.98% 83.51% -0.47%
==========================================
Files 5 5
Lines 356 358 +2
==========================================
Hits 299 299
- Misses 57 59 +2 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @storopoli. A test case to cover this one would be great too.
function _check_output_dst(s::AbstractString) | ||
dir = dirname(s) | ||
isdir(dir) || throw(ArgumentError("directory does not exist: $(dir)")) | ||
if !isdir(dir) | ||
_dir = dirname(joinpath(pwd(), s)) | ||
isdir(_dir) || throw(ArgumentError("directory does not exist: $(dir)")) | ||
end | ||
return nothing | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
function _check_output_dst(s::AbstractString) | |
dir = dirname(s) | |
isdir(dir) || throw(ArgumentError("directory does not exist: $(dir)")) | |
if !isdir(dir) | |
_dir = dirname(joinpath(pwd(), s)) | |
isdir(_dir) || throw(ArgumentError("directory does not exist: $(dir)")) | |
end | |
return nothing | |
end | |
function _check_output_dst(s::AbstractString) | |
s = abspath(s) | |
dir = dirname(s) | |
isdir(dir) || throw(ArgumentError("directory does not exist: $(dir)")) | |
return nothing | |
end |
is probably sufficient.
Replaced by #5, thanks @storopoli. |
Right now the
run!
function errors on the README instructions.The idea here is to add an
if
to check it thedirname
of thejoinpath(pwd(), output)
is a dir instead of throwing error straight away.