mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-05-13 16:37:27 +00:00
Auto create parent directory when saving session file
This commit is contained in:
parent
41488fe8ba
commit
51cc6ec525
1 changed files with 1 additions and 0 deletions
|
|
@ -517,6 +517,7 @@ def save_as_session_part2(boss: BossType, opts: SaveAsSessionOptions, path: str)
|
|||
from .config import atomic_save
|
||||
path = os.path.abspath(os.path.expanduser(path))
|
||||
session = '\n'.join(boss.serialize_state_as_session(path, opts))
|
||||
os.makedirs(os.path.dirname(path), exist_ok=True)
|
||||
atomic_save(session.encode(), path)
|
||||
if not opts.save_only:
|
||||
boss.edit_file(path)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue