Skip to content

Commit 97c3d20

Browse files
committed
Fix progress sync bug
1 parent 4f12695 commit 97c3d20

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

app/commands/progress/sync/on.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,4 +113,4 @@ def on() -> None:
113113

114114
config.progress_remote = True
115115
with open(config.path / GITMASTERY_CONFIG_NAME, "w") as gitmastery_config_file:
116-
gitmastery_config_file.write(json.dumps(config, indent=2))
116+
gitmastery_config_file.write(config.to_json())

app/utils/gitmastery.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,10 @@ def _find_root(filename: str) -> Optional[Tuple[Path, int]]:
3434

3535
def _read_config(path: Path, filename: str) -> Dict:
3636
with open(path / filename, "r") as f:
37-
return json.loads(f.read())
37+
contents = f.read()
38+
if contents.strip() == "":
39+
return {}
40+
return json.loads(contents)
3841

3942

4043
def find_gitmastery_root() -> Optional[Tuple[Path, int]]:
@@ -65,7 +68,7 @@ def read_gitmastery_config(gitmastery_config_path: Path, cds: int) -> GitMastery
6568
return GitMasteryConfig(
6669
path=gitmastery_config_path,
6770
cds=cds,
68-
progress_local=raw_config.get("progress_local", False),
71+
progress_local=raw_config.get("progress_local", True),
6972
progress_remote=raw_config.get("progress_remote", False),
7073
)
7174

0 commit comments

Comments
 (0)