This repository was archived by the owner on Nov 6, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +12
-4
lines changed
Expand file tree Collapse file tree 3 files changed +12
-4
lines changed Original file line number Diff line number Diff line change 1- BAK_VERSION = "0.2.0a1 "
1+ BAK_VERSION = "0.2.1a1 "
Original file line number Diff line number Diff line change 33
44from pathlib import Path
55from re import sub
6+ from shutil import copy2
67
78from config import Config , KeyNotFoundError
89
@@ -50,13 +51,15 @@ def __init__(self):
5051 self .config_dir = Path ("~/.config" ).expanduser ().resolve ()
5152
5253 self .config_file = self .config_dir / 'bak.cfg'
54+ if not self .config_file .exists ():
55+ copy2 (self .config_dir / 'bak.cfg.default' , self .config_file )
5356 _cfg = Config (str (self .config_file ))
5457
5558 reload = False
5659 for cfg_value in self .DEFAULT_VALUES :
5760 if cfg_value not in _cfg .as_dict ():
58- with open (self .config_file , 'w ' ) as _file :
59- _file .write (
61+ with open (self .config_file , 'a ' ) as _file :
62+ _file .writelines (
6063 f"{ cfg_value } : { self .DEFAULT_VALUES [cfg_value ]} \n " )
6164 _file .close ()
6265 reload = True
Original file line number Diff line number Diff line change 88 'rich==9.1.0' ]
99
1010setup (name = 'bak' ,
11- version = '0.2.0a1 ' ,
11+ version = '0.2.1a1 ' ,
1212 description = 'the .bak manager' ,
1313 author = 'ChanceNCounter' ,
14142828 config_dir = os .path .expanduser ("~/.config" )
2929
3030config_file = os .path .join (config_dir , 'bak.cfg' )
31+ default_config = os .path .join (config_dir , 'bak.cfg.default' )
3132
3233if not os .path .exists (config_file ):
3334 copy2 ('bak/default.cfg' , config_file )
35+
36+ if not os .path .exists (default_config ):
37+ copy2 ('bak/default.cfg' , default_config )
38+
You can’t perform that action at this time.
0 commit comments