Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: now whoami #585

Closed
renatorib opened this issue May 25, 2017 · 3 comments
Closed

Feature request: now whoami #585

renatorib opened this issue May 25, 2017 · 3 comments

Comments

@renatorib
Copy link

renatorib commented May 25, 2017

Simple but effective command to know which account you are in.

$ now whoami
> renatorib

(I don't know how Teams works, but perhaps it can help with Teams too)

@rauchg
Copy link
Member

rauchg commented May 25, 2017

Yep. now switch kinda tells you already, but not sure if it does if you have no teams

TooTallNate added a commit that referenced this issue May 26, 2017
Not logged in:

```
$ now whoami
> Not currently logged in! Please run `now --login`.
```

Logged in, stdout is a TTY:

```
$ now whoami
> tootallnate
$ now switch zeit
$ now whoami
> zeit
```

Stdout is NOT a TTY:

```
$ echo "Logged in to Now as $(now whoami)"
Logged in to Now as tootallnate
```

Closes #585.
rauchg pushed a commit that referenced this issue May 26, 2017
Not logged in:

```
$ now whoami
> Not currently logged in! Please run `now --login`.
```

Logged in, stdout is a TTY:

```
$ now whoami
> tootallnate
$ now switch zeit
$ now whoami
> zeit
```

Stdout is NOT a TTY:

```
$ echo "Logged in to Now as $(now whoami)"
Logged in to Now as tootallnate
```

Closes #585.
@leo leo reopened this May 26, 2017
@chabou
Copy link
Contributor

chabou commented May 29, 2017

Seems fixed by 24ce1c2

However, I need the same thing for current team. I saw a revert and a new version without team (for consistency).

My problem is: I want to show (in prompt) current team or current user if there is no team. I had to parse .now.json with 3 different ways (js, ruby, python) to adapt to user environnement. It will be really better to exec now whoami or/and now teams current and not parsing now internals.

This is my current solution: https://github.com/chabou/pure-now/blob/v1.5.4/now_functions.zsh
And there is a PR to hyper-statusline by @maxbeatty with the same need: henrikruscon/hyper-statusline@30f9f44

I can make a PR for this new command if you give me its name:

  • now teams current
  • now teams info
  • now teams show
  • now teams status

@chabou
Copy link
Contributor

chabou commented Jun 26, 2017

Any advice @leo ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants