Skip to content

Commit

Permalink
[mdir] Relax regular expression to match all filenames but hidden ones
Browse files Browse the repository at this point in the history
  • Loading branch information
McSinyx committed Dec 7, 2019
1 parent fa6b4e6 commit 964c019
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
6 changes: 6 additions & 0 deletions Changes.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# Changes in 2.4.1 (WIP)

Fixed:

- [mdir] Relax regular expression to match all filenames but hidden ones

# Changes in 2.4.0

IMPORTANT:
Expand Down
5 changes: 3 additions & 2 deletions widgets/mdir_all.lua
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,13 @@ function mdir_all.async(format, warg, callback)
if starting_points == "" then return callback{ 0, 0 } end

local new, cur = 0, 0
local find = "find" .. starting_points .. " -type f ! -path '*/.*'"
spawn.with_line_callback(
"find" .. starting_points .. " -type f -regex '.*/cur/.*2,[^S]*$';",
find .. " -path '*/cur/*'",
{ stdout = function (filename) cur = cur + 1 end,
output_done = function ()
spawn.with_line_callback(
"find" .. starting_points .. " -type f -path '*/new/*';",
find .. " -path '*/new/*'",
{ stdout = function (filename) new = new + 1 end,
output_done = function () callback{ new, cur } end })
end })
Expand Down

0 comments on commit 964c019

Please sign in to comment.