Skip to content

Commit

Permalink
show stat after toggle exec
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-hao committed Jun 17, 2024
1 parent 453ad93 commit 156372c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion chadtree/transitions/stat.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@


@rpc(blocking=False)
async def _stat(state: State, is_visual: bool) -> None:
async def stat(state: State, is_visual: bool) -> None:
"""
Print file stat to cmdline
"""
Expand Down
7 changes: 6 additions & 1 deletion chadtree/transitions/toggle_exec.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from asyncio import gather
from os import chmod, stat, stat_result
from pathlib import PurePath
from stat import S_ISDIR, S_IXGRP, S_IXOTH, S_IXUSR
Expand All @@ -8,6 +9,7 @@
from ..state.next import forward
from ..state.types import State
from .shared.index import indices
from .stat import stat as _stat
from .types import Stage


Expand Down Expand Up @@ -39,5 +41,8 @@ def cont() -> Iterator[Tuple[PurePath, stat_result]]:
chmod(path, st.st_mode ^ S_IXUSR ^ S_IXGRP ^ S_IXOTH)

invalidate_dirs = {path.parent for path in stats.keys()}
new_state = await forward(state, invalidate_dirs=invalidate_dirs)
new_state, _ = await gather(
forward(state, invalidate_dirs=invalidate_dirs),
_stat(state, is_visual=is_visual),
)
return Stage(state=new_state)

0 comments on commit 156372c

Please sign in to comment.