lukeed / generator-taskr

Official Yeoman generator for Taskr
25 stars 2 forks source link

How about getting GitHub username with GitHub API ? #5

Open sotayamashita opened 9 years ago

sotayamashita commented 9 years ago

Like yeoman/generator-generator/app/index.js.

var GitHubApi = require('github');

github.user.getFrom({
    user: name
  }, function (err, res) {
    if (err) {
      log.error('Cannot fetch your github profile. Make sure you\'ve typed it correctly.');
      res = emptyGithubRes;
    }

    cb(JSON.parse(JSON.stringify(res)));
})
hzlmn commented 9 years ago

If this necessary there is a wrapper module called gh-user

var ghUser = require('gh-user');

ghUser('sindresorhus', function (err, user) {
    console.log(user);
    //=> { login: 'sindresorhus', id: 170270, ... }
});

It will be like this. @bucaran what do you think, seems interesting?

ghost commented 9 years ago

@sotayamashita @drKraken Cool. So, we get the username from the user and use gh-user to find the URL. But what's the advantage for generator-fly exactly?

Thanks!

hzlmn commented 9 years ago

@bucaran You could get email, websites in such way and not add separate promt for it. But i not like this, it's more dependencies, dependencies => issues in future

ghost commented 9 years ago

@drKraken I see, we do ask for the email, but once you type it once it goes into the cache so you don't have to retype it each time you use the generator. As for the website, by default → github.com/USER_NAME.

So, while I think this is a nice feature to have, but we can give it low priority for now.

@sotayamashita If this becomes an issue in the future we can refer back to this issue.

:smile:

sotayamashita commented 9 years ago

@drKraken can I implement this feature ?

ghost commented 9 years ago

@sotayamashita Sure. Go for it and send a PR.

sotayamashita commented 9 years ago

@drKraken :+1:

hzlmn commented 9 years ago

@sotayamashita absolutely

sotayamashita commented 9 years ago

:construction: - https://github.com/sotayamashita/generator-fly/tree/feature/github-username

hzlmn commented 9 years ago

@sotayamashita i don't see any differences, what's a point?

ghost commented 9 years ago

@sotayamashita Updates? :smile:

sotayamashita commented 9 years ago

@bucaran sorry not to develop. I am so busy now but I am developing now.

lukeed commented 8 years ago

imo, no real need for this. current flow is very smooth & fast