Commit graph

16 commits

Author SHA1 Message Date
Kristján Oddsson
7a3e47ff3e Update error message link and wording. 2021-07-21 12:46:44 +01:00
Jose Garcia
8faee1e5a9 Update main.go 2021-07-20 08:09:48 -04:00
Jose Garcia
5e803aca79 Merge pull request #20 from github/jg/better-conn-handling
Bump go-liveshare w/ better connection handling and simpler ssh setup
2021-07-20 08:08:33 -04:00
Jose Garcia
6642fb520a Better connection handling and simpler ssh setup 2021-07-20 08:04:34 -04:00
Issy Long
2f8d00e0f8 Merge pull request #19 from github/version-cmd
cmd/ghcs/main: Add `--version` flag
2021-07-20 13:02:41 +01:00
Issy Long
4582fed1cc cmd/ghcs/main: Add --version flag
- This is built into Cobra the argument parser. Now `ghcs --version`
  exists.
- When we prepare to bump the version, we need to remember to update
  this value else the Homebrew formula, GitHub releases and the `ghcs
  --version` output will be mismatched.
- Fixes https://github.com/github/ghcs/issues/16.
2021-07-19 18:45:18 +01:00
Issy Long
cb29b11ab2 cmd/ghcs/main: Fail gracefully if GITHUB_TOKEN entirely unset
- I have my GitHub API token in my environment as
  `HOMEBREW_GITHUB_API_TOKEN`, so with things that need `GITHUB_TOKEN` I
  have to remember to `export GITHUB_TOKEN=$HOMEBREW_GITHUB_API_TOKEN`.
- I didn't for this tool, and got this unfriendly error message:

```
❯ ghcs list
Error: error getting user: Bad credentials
Usage:
  ghcs list [flags]

Flags:
  -h, --help   help for list

error getting user: Bad credentials
```

- This moves the "do you have a `GITHUB_TOKEN`" question to the very
  beginning (no guarantees about org SSO access, just a string that
  exists), erroring out with a nice message if users don't have that
  envvar set:

```
issyl0 in cetus in ~/repos/github/ghcs/cmd/ghcs on gracefully-fail-if-token-envvar-unset
❯ ./ghcs list
The GITHUB_TOKEN environment variable is required. Create a Personal Access Token with org SSO access at https://github.com/settings/tokens/new.

issyl0 in cetus in ~/repos/github/ghcs/cmd/ghcs on gracefully-fail-if-token-envvar-unset
❯ export GITHUB_TOKEN=$HOMEBREW_GITHUB_API_TOKEN

❯ ./ghcs list
+--------------------------------+--------------------+------------------------------------+----------+---------------------------+
|              NAME              |     REPOSITORY     |               BRANCH               |  STATE   |        CREATED AT         |
+--------------------------------+--------------------+------------------------------------+----------+---------------------------+
| issyl0-github-cat-ggrpj5fvwvr  | github/cat         | dependabot/bundler/graphql-1.12.13 | Shutdown | 2021-07-13T12:36:53+01:00 |
+--------------------------------+--------------------+------------------------------------+----------+---------------------------+
```
2021-07-19 18:10:15 +01:00
Jose Garcia
570a407bac Fix directive 2021-07-19 08:00:51 -04:00
Jose Garcia
798413848b Portfowarding private/public/forward now supported 2021-07-17 20:32:47 -04:00
Jose Garcia
3c42ab8f7a ghcs ports v1 2021-07-16 18:45:38 -04:00
Jose Garcia
44698ea1de Merge branch 'main' into mislav/timeout 2021-07-15 11:54:52 -04:00
Jose Garcia
ecea5b821a Give more time to start 2021-07-15 14:35:26 +00:00
Mislav Marohnić
d506a97419 Increase ssh command timeout and improve error message
- My `github/github` codespace failed to start within 10s
- Output more precise error message
2021-07-15 16:10:03 +02:00
Mislav Marohnić
d46420e812 Improve ssh command
- Ensure parent process exits when `ssh` sub-process is done
- Enable connections to `github/github` when `--profile` flag wasn't given
2021-07-15 16:07:23 +02:00
Jose Garcia
a5f558bf2a Makes secrets work 2021-07-15 08:49:18 -04:00
Jose Garcia
4a0eaa3da5 Latest and greatest 2021-07-14 16:12:30 -04:00