Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4cc96d4

Browse files
fix(service): resolve malformed plist generation and add validation (#24)
* fix(service): resolve malformed plist generation and add validation - Removed duplicate `<key>StartInterval</key>` entry in `install_macos` which caused launchctl bootstrap failure (Input/output error). - Added `plutil -lint` step to validate generated property lists before loading, ensuring syntax errors are caught with explicit diagnostics rather than opaque IPC errors. * chore: bump version 0.10.1 → 0.10.2
1 parent ac4097b commit 4cc96d4

4 files changed

Lines changed: 11 additions & 5 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# 🔭 Git Pulsar (v0.10.1)
1+
# 🔭 Git Pulsar (v0.10.2)
22

33
[![Tests](https://github.com/jacksonfergusondev/git-pulsar/actions/workflows/ci.yml/badge.svg)](https://github.com/jacksonfergusondev/git-pulsar/actions)
44
[![Python 3.12+](https://img.shields.io/badge/python-3.12+-blue.svg)](https://www.python.org/downloads/)

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "git-pulsar"
3-
version = "0.10.1"
3+
version = "0.10.2"
44
description = "Automated, paranoid git backups for students and casual coding."
55
readme = "README.md"
66
authors = [
@@ -54,7 +54,7 @@ pythonpath = ["."]
5454
omit = ["src/service.py"]
5555

5656
[tool.bumpversion]
57-
current_version = "0.10.1"
57+
current_version = "0.10.2"
5858
parse = "(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)"
5959
serialize = ["{major}.{minor}.{patch}"]
6060
search = "{current_version}"

src/git_pulsar/service.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ def install_macos(
5050
<string>{executable}</string>
5151
</array>
5252
<key>StartInterval</key>
53-
<key>StartInterval</key>
5453
<integer>{interval}</integer>
5554
<key>RunAtLoad</key>
5655
<true/>
@@ -65,6 +64,13 @@ def install_macos(
6564
with open(plist_path, "w") as f:
6665
f.write(content)
6766

67+
# 🔍 Validate the plist syntax before asking launchd to eat it
68+
try:
69+
subprocess.run(["plutil", "-lint", str(plist_path)], check=True)
70+
except subprocess.CalledProcessError:
71+
print(f"❌ Generated plist is invalid: {plist_path}")
72+
sys.exit(1)
73+
6874
subprocess.run(["launchctl", "unload", str(plist_path)], stderr=subprocess.DEVNULL)
6975
subprocess.run(["launchctl", "load", str(plist_path)], check=True)
7076
print(f"✅ Pulsar background service active (macOS).\nLogs: {log_path}")

uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)