File tree Expand file tree Collapse file tree 4 files changed +12
-11
lines changed
Expand file tree Collapse file tree 4 files changed +12
-11
lines changed Original file line number Diff line number Diff line change @@ -54,10 +54,12 @@ namespace mamba
5454
5555 inline void make_executable (const fs::u8path& p)
5656 {
57- const auto permissions = fs::perms::owner_all | fs::perms::group_all |
58- fs::perms::others_read | fs::perms::others_exec;
59- if (! fs::has_permissions (p, permissions))
60- fs::permissions (p, permissions);
57+ const auto permissions = fs::perms::owner_all | fs::perms::group_all
58+ | fs::perms::others_read | fs::perms::others_exec;
59+ if (!fs::has_permissions (p, permissions))
60+ {
61+ fs::permissions (p, permissions);
62+ }
6163 }
6264
6365 // @return `true` if `TemporaryFile` will not delete files once destroy.
Original file line number Diff line number Diff line change @@ -1140,7 +1140,7 @@ namespace mamba::fs
11401140 }
11411141
11421142 // Check if we have modification rights on a path
1143- bool has_permissions (const u8path&, fs::perms const &);
1143+ bool has_permissions (const u8path&, const fs::perms&);
11441144
11451145 // void permissions(const path& p, perms prms, perm_options opts = perm_options::replace);
11461146 // void permissions(const path& p, perms prms, error_code& ec) noexcept;
Original file line number Diff line number Diff line change @@ -1004,10 +1004,10 @@ namespace mamba
10041004
10051005 const auto permissions = fs::perms::owner_all | fs::perms::group_all
10061006 | fs::perms::others_read | fs::perms::others_exec;
1007- if (! fs::has_permissions (cache_dir, permissions)) {
1007+ if (!fs::has_permissions (cache_dir, permissions))
1008+ {
10081009 fs::permissions (cache_dir, permissions, fs::perm_options::replace);
1009- LOG_TRACE << " Set permissions on cache directory " << cache_dir
1010- << " to 'rwxrwxr-x'" ;
1010+ LOG_TRACE << " Set permissions on cache directory " << cache_dir << " to 'rwxrwxr-x'" ;
10111011 }
10121012
10131013 std::error_code ec;
Original file line number Diff line number Diff line change @@ -83,9 +83,8 @@ namespace mamba::fs
8383#endif
8484 }
8585
86-
87- bool has_permissions (const u8path& path, fs::perms const & perm) {
88-
86+ bool has_permissions (const u8path& path, const fs::perms& perm)
87+ {
8988 // Get path permissions
9089 auto p = std::filesystem::status (path).permissions ();
9190
You can’t perform that action at this time.
0 commit comments