Преглед изворни кода

[F] Make config path only when it's needed

Azalea (on HyDEV-Daisy) пре 3 година
родитељ
комит
2c8261dc9a
2 измењених фајлова са 6 додато и 2 уклоњено
  1. 4 0
      README.md
  2. 2 2
      hyfetch/main.py

+ 4 - 0
README.md

@@ -48,6 +48,10 @@ Feel free to experiment with it!
 * [ ] Add interactive configurator for adjusting brightness
 * [ ] Add configuration to emphasize certain parts of the original ASCII art (to make icons like Fedora and Ubuntu look nicer)
 
+### 1.0.7
+
+* Fix: Make config path not on init but when it's actually needed.
+
 ### 1.0.6
 
 * Remove `hypy_utils` dependency to make packaging easier.

+ 2 - 2
hyfetch/main.py

@@ -13,8 +13,7 @@ from .presets import PRESETS, ColorProfile
 from .serializer import json_stringify
 
 CONFIG_PATH = Path.home() / '.config/hyfetch.json'
-CONFIG_PATH.parent.mkdir(exist_ok=True, parents=True)
-VERSION = '1.0.6'
+VERSION = '1.0.7'
 
 
 @dataclass
@@ -23,6 +22,7 @@ class Config:
     mode: AnsiMode
 
     def save(self):
+        CONFIG_PATH.parent.mkdir(exist_ok=True, parents=True)
         CONFIG_PATH.write_text(json_stringify(self), 'utf-8')