diff options
| author | ruki <[email protected]> | 2022-07-30 23:39:55 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2022-07-30 23:39:55 +0800 |
| commit | ef9fc9d6f441c63f58c7f244e5afeb82b1b4bf22 (patch) | |
| tree | da82c04c24c94381d2786c85fccd6fb70f6dbde9 | |
| parent | 48bbdc61c663ac460e4fbf8768b22997bed0efec (diff) | |
remove repeat events for watch
| -rw-r--r-- | xmake/plugins/watch/main.lua | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/xmake/plugins/watch/main.lua b/xmake/plugins/watch/main.lua index 3293296fa..af96349b8 100644 --- a/xmake/plugins/watch/main.lua +++ b/xmake/plugins/watch/main.lua @@ -134,10 +134,11 @@ function main() status = "deleted" end print(event.path, status) - table.insert(events, event) + -- we use map to remove repeat event + events[event.path .. tostring(event.type)] = event count = count + 1 elseif count > 0 then - _run_command(events) + _run_command(table.values(events)) count = 0 end end |
