ghosttrap-cli 0.3.22__tar.gz → 0.3.23__tar.gz
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.
- {ghosttrap_cli-0.3.22 → ghosttrap_cli-0.3.23}/PKG-INFO +1 -1
- {ghosttrap_cli-0.3.22 → ghosttrap_cli-0.3.23}/ghosttrap_cli/cli.py +14 -4
- {ghosttrap_cli-0.3.22 → ghosttrap_cli-0.3.23}/ghosttrap_cli.egg-info/PKG-INFO +1 -1
- {ghosttrap_cli-0.3.22 → ghosttrap_cli-0.3.23}/pyproject.toml +1 -1
- {ghosttrap_cli-0.3.22 → ghosttrap_cli-0.3.23}/README.md +0 -0
- {ghosttrap_cli-0.3.22 → ghosttrap_cli-0.3.23}/ghosttrap_cli/__init__.py +0 -0
- {ghosttrap_cli-0.3.22 → ghosttrap_cli-0.3.23}/ghosttrap_cli.egg-info/SOURCES.txt +0 -0
- {ghosttrap_cli-0.3.22 → ghosttrap_cli-0.3.23}/ghosttrap_cli.egg-info/dependency_links.txt +0 -0
- {ghosttrap_cli-0.3.22 → ghosttrap_cli-0.3.23}/ghosttrap_cli.egg-info/entry_points.txt +0 -0
- {ghosttrap_cli-0.3.22 → ghosttrap_cli-0.3.23}/ghosttrap_cli.egg-info/requires.txt +0 -0
- {ghosttrap_cli-0.3.22 → ghosttrap_cli-0.3.23}/ghosttrap_cli.egg-info/top_level.txt +0 -0
- {ghosttrap_cli-0.3.22 → ghosttrap_cli-0.3.23}/setup.cfg +0 -0
|
@@ -27,7 +27,7 @@ def _harden_signals():
|
|
|
27
27
|
except (OSError, ValueError):
|
|
28
28
|
pass
|
|
29
29
|
|
|
30
|
-
__version__ = "0.3.
|
|
30
|
+
__version__ = "0.3.23"
|
|
31
31
|
|
|
32
32
|
GHOSTTRAP_SERVER = "wss://ghosttrap.io/stream/"
|
|
33
33
|
CONFIG_DIR = os.path.expanduser("~/.ghosttrap")
|
|
@@ -237,12 +237,22 @@ def _get_repo_entry(config, requested=None):
|
|
|
237
237
|
for k, entry in repos.items():
|
|
238
238
|
if f"{entry.get('owner')}/{entry.get('name')}" == cwd_repo:
|
|
239
239
|
return k, entry
|
|
240
|
-
|
|
241
|
-
|
|
240
|
+
if cwd_repo:
|
|
241
|
+
print(f"error: {cwd_repo} is not in your config. run 'ghosttrap setup' to claim it, or pass --repo owner/name.", file=sys.stderr)
|
|
242
|
+
else:
|
|
243
|
+
print("error: not inside a git repo with a github remote, and no --repo given.", file=sys.stderr)
|
|
244
|
+
available = sorted(
|
|
245
|
+
f"{e.get('owner')}/{e.get('name')}"
|
|
246
|
+
for e in repos.values()
|
|
247
|
+
if e.get('owner') and e.get('name')
|
|
248
|
+
)
|
|
249
|
+
if available:
|
|
250
|
+
print(f"available: {', '.join(available)}", file=sys.stderr)
|
|
251
|
+
sys.exit(1)
|
|
242
252
|
|
|
243
253
|
|
|
244
254
|
def _get_repo_token(config, requested=None):
|
|
245
|
-
"""Get the repo token. If `requested` is 'owner/name', match strictly. Else cwd, else
|
|
255
|
+
"""Get the repo token. If `requested` is 'owner/name', match strictly. Else cwd, else error out."""
|
|
246
256
|
_, entry = _get_repo_entry(config, requested)
|
|
247
257
|
return entry["token"]
|
|
248
258
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|