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

Add now plugin that show the current team #175

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

nicobarray
Copy link

Hi everyone :)

First of all, a quick screenshot:

image
the now logo with the current username on its right

Rational

Because I always switch between at least 2 now teams, I want to know which team I use right now (too many time I deployed my projects on the wrong now team 😅 )

This PR contains just that: a now plugin that shows the current team used (or the now user if none is activated).

Some informations:

  • I first wanted to execa the now cli to get the up to date account informations, yet I could not made it work (maybe an issue with the code running in the render thread ? I'm not versed in electron subtleties, maybe it was a simple error that could be fixes)
  • Then I decided to check the now cli code to see if I could fetch the current user informations, and it was possible through /www/user and /teams routes on the now endpoint used by the official cli.
  • The now plugin fetches each minute those endpoint to deduce the current user and renders it next to zeit logo ▲

I think it is straightforward enough, yet feel free to discuss/ask me anything about the implementation, I'll be happy to update/explain anything.

Thanks for your time.

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

Successfully merging this pull request may close these issues.

1 participant