-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
src: revert filesystem::path changes #55015
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,12 +17,20 @@ | |
namespace { | ||
|
||
std::string WildcardIfDir(const std::string& res) noexcept { | ||
auto path = std::filesystem::path(res); | ||
auto file_status = std::filesystem::status(path); | ||
if (file_status.type() == std::filesystem::file_type::directory) { | ||
path /= "*"; | ||
uv_fs_t req; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @joyeecheung Is it safe to keep this function, or do we need this revert? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is |
||
int rc = uv_fs_stat(nullptr, &req, res.c_str(), nullptr); | ||
if (rc == 0) { | ||
const uv_stat_t* const s = static_cast<const uv_stat_t*>(req.ptr); | ||
if ((s->st_mode & S_IFMT) == S_IFDIR) { | ||
// add wildcard when directory | ||
if (res.back() == node::kPathSeparator) { | ||
return res + "*"; | ||
} | ||
return res + node::kPathSeparator + "*"; | ||
} | ||
} | ||
return path.string(); | ||
uv_fs_req_cleanup(&req); | ||
return res; | ||
} | ||
|
||
void FreeRecursivelyNode( | ||
|
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.
You can minimize the diff/potential conflicts if this is named as
cache_dir_with_tag_str