Skip to content
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

Regex match (now basename) #137

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
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 src/WinRPM.jl
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ function do_install(package::Package)
error("failed to download $name $(data[2]) from $source/$path.")
end
cache = getcachedir(source)
path2 = joinpath(cache,escape(path))
path2 = joinpath(cache, match(r"[^/]+$",path).match)
Copy link

@omus omus Feb 6, 2018

Choose a reason for hiding this comment

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

I found that using a simple regex match to pick off the filename solved my problems.

The match should probably be replaced with basename

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Did not know about that function! That seems to do the trick just fine.

open(path2, "w") do f
write(f, data[1])
end
Expand Down