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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ghosttrap-cli
3
- Version: 0.3.22
3
+ Version: 0.3.23
4
4
  Summary: Watch for errors streaming from ghosttrap.io
5
5
  Project-URL: Homepage, https://github.com/alex-rowley/ghosttrap-cli
6
6
  Requires-Python: >=3.10
@@ -27,7 +27,7 @@ def _harden_signals():
27
27
  except (OSError, ValueError):
28
28
  pass
29
29
 
30
- __version__ = "0.3.22"
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
- k = next(iter(repos))
241
- return k, repos[k]
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 first."""
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
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ghosttrap-cli
3
- Version: 0.3.22
3
+ Version: 0.3.23
4
4
  Summary: Watch for errors streaming from ghosttrap.io
5
5
  Project-URL: Homepage, https://github.com/alex-rowley/ghosttrap-cli
6
6
  Requires-Python: >=3.10
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "ghosttrap-cli"
7
- version = "0.3.22"
7
+ version = "0.3.23"
8
8
  description = "Watch for errors streaming from ghosttrap.io"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10"
File without changes
File without changes