github-sync-agent 0.1.2__py3-none-any.whl → 0.1.3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- github_sync/__init__.py +1 -1
- github_sync/cli.py +18 -2
- {github_sync_agent-0.1.2.dist-info → github_sync_agent-0.1.3.dist-info}/METADATA +1 -1
- github_sync_agent-0.1.3.dist-info/RECORD +10 -0
- github_sync_agent-0.1.2.dist-info/RECORD +0 -10
- {github_sync_agent-0.1.2.dist-info → github_sync_agent-0.1.3.dist-info}/WHEEL +0 -0
- {github_sync_agent-0.1.2.dist-info → github_sync_agent-0.1.3.dist-info}/entry_points.txt +0 -0
- {github_sync_agent-0.1.2.dist-info → github_sync_agent-0.1.3.dist-info}/top_level.txt +0 -0
github_sync/__init__.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "0.1.
|
|
1
|
+
__version__ = "0.1.3"
|
github_sync/cli.py
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import logging
|
|
2
|
+
import platform
|
|
2
3
|
import sys
|
|
3
4
|
from pathlib import Path
|
|
4
5
|
|
|
@@ -35,10 +36,16 @@ def _setup_logging(cfg: dict) -> None:
|
|
|
35
36
|
def cli(ctx: click.Context, config_path: Path | None) -> None:
|
|
36
37
|
"""GitHub Sync Agent — sync local projects to GitHub."""
|
|
37
38
|
ctx.ensure_object(dict)
|
|
39
|
+
|
|
40
|
+
# init creates the config — it must not require one to exist first
|
|
41
|
+
if ctx.invoked_subcommand == "init":
|
|
42
|
+
return
|
|
43
|
+
|
|
38
44
|
try:
|
|
39
45
|
ctx.obj["cfg"] = config.load(config_path)
|
|
40
46
|
except (FileNotFoundError, ValueError) as exc:
|
|
41
47
|
click.echo(f"Error: {exc}", err=True)
|
|
48
|
+
click.echo("Run 'github-sync init' to create a config file.", err=True)
|
|
42
49
|
sys.exit(1)
|
|
43
50
|
|
|
44
51
|
|
|
@@ -123,6 +130,15 @@ def status(ctx: click.Context) -> None:
|
|
|
123
130
|
# init
|
|
124
131
|
# ---------------------------------------------------------------------------
|
|
125
132
|
|
|
133
|
+
def _install_hint(tool: str) -> str:
|
|
134
|
+
system = platform.system()
|
|
135
|
+
if system == "Darwin":
|
|
136
|
+
return f"brew install {tool}"
|
|
137
|
+
if system == "Linux":
|
|
138
|
+
return f"sudo apt-get install -y {tool}"
|
|
139
|
+
return f"Install {tool} from your system package manager"
|
|
140
|
+
|
|
141
|
+
|
|
126
142
|
@cli.command()
|
|
127
143
|
def init() -> None:
|
|
128
144
|
"""Interactive setup wizard — run this first on a new machine."""
|
|
@@ -136,7 +152,7 @@ def init() -> None:
|
|
|
136
152
|
click.echo(f" ✓ git found: {git_ver}")
|
|
137
153
|
else:
|
|
138
154
|
click.echo(click.style(" ✗ git is not installed.", fg="red"))
|
|
139
|
-
click.echo(" Install it with:
|
|
155
|
+
click.echo(f" Install it with: {_install_hint('git')}")
|
|
140
156
|
sys.exit(1)
|
|
141
157
|
|
|
142
158
|
# ── 2. Check gh ─────────────────────────────────────────────────────────
|
|
@@ -145,7 +161,7 @@ def init() -> None:
|
|
|
145
161
|
click.echo(f" ✓ gh found: {gh_ver}")
|
|
146
162
|
else:
|
|
147
163
|
click.echo(click.style(" ✗ gh (GitHub CLI) is not installed.", fg="red"))
|
|
148
|
-
click.echo(" Install it with:
|
|
164
|
+
click.echo(f" Install it with: {_install_hint('gh')}")
|
|
149
165
|
sys.exit(1)
|
|
150
166
|
|
|
151
167
|
# ── 3. GitHub authentication ─────────────────────────────────────────────
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
github_sync/__init__.py,sha256=XEqb2aiIn8fzGE68Mph4ck1FtQqsR_am0wRWvrYPffQ,22
|
|
2
|
+
github_sync/agent.py,sha256=2WnJCwupDwT3C9bNZLoj2CAvZW-eoqZChqFTk4wNRKw,6692
|
|
3
|
+
github_sync/cli.py,sha256=xsbYJXhlSGSDgEOlTm43XcDSdn5M83u2uz6UuzfG5s0,9827
|
|
4
|
+
github_sync/config.py,sha256=BQrSW7DyhcZB6gZnDKkc-W6u1vtD-l76Rn_gW8Egypk,1444
|
|
5
|
+
github_sync/setup.py,sha256=2ZO0ZCCxQ_LyVSdQbWrObwjjBQCDLqdu_IHplUqW0qU,4720
|
|
6
|
+
github_sync_agent-0.1.3.dist-info/METADATA,sha256=_FnEkvuZNeHDyHSojYdDEg6z-cxLbVWlwn6Upf3jIxo,2644
|
|
7
|
+
github_sync_agent-0.1.3.dist-info/WHEEL,sha256=K260EYznzXsJYBQGqmI8VTxEdiZYNvDZwW9cBh9-_MA,91
|
|
8
|
+
github_sync_agent-0.1.3.dist-info/entry_points.txt,sha256=-LmJUTvRzj5cvyS-dEWdipouBj3dgkW6hqrTz1GmyGw,53
|
|
9
|
+
github_sync_agent-0.1.3.dist-info/top_level.txt,sha256=fPYTA83USK1N4JwfouV8zcejgWfWmqRAKQVDCAT8a5I,12
|
|
10
|
+
github_sync_agent-0.1.3.dist-info/RECORD,,
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
github_sync/__init__.py,sha256=YvuYzWnKtqBb-IqG8HAu-nhIYAsgj9Vmc_b9o7vO-js,22
|
|
2
|
-
github_sync/agent.py,sha256=2WnJCwupDwT3C9bNZLoj2CAvZW-eoqZChqFTk4wNRKw,6692
|
|
3
|
-
github_sync/cli.py,sha256=ndmfTQhK4KbtVEjXWuOg4RLs3UVFpgb0rZAf_YZFWgs,9336
|
|
4
|
-
github_sync/config.py,sha256=BQrSW7DyhcZB6gZnDKkc-W6u1vtD-l76Rn_gW8Egypk,1444
|
|
5
|
-
github_sync/setup.py,sha256=2ZO0ZCCxQ_LyVSdQbWrObwjjBQCDLqdu_IHplUqW0qU,4720
|
|
6
|
-
github_sync_agent-0.1.2.dist-info/METADATA,sha256=u4dfGfpiUf-TQgtldf043Wj1NSZFvTy8fJG2bYj4dFo,2644
|
|
7
|
-
github_sync_agent-0.1.2.dist-info/WHEEL,sha256=K260EYznzXsJYBQGqmI8VTxEdiZYNvDZwW9cBh9-_MA,91
|
|
8
|
-
github_sync_agent-0.1.2.dist-info/entry_points.txt,sha256=-LmJUTvRzj5cvyS-dEWdipouBj3dgkW6hqrTz1GmyGw,53
|
|
9
|
-
github_sync_agent-0.1.2.dist-info/top_level.txt,sha256=fPYTA83USK1N4JwfouV8zcejgWfWmqRAKQVDCAT8a5I,12
|
|
10
|
-
github_sync_agent-0.1.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|