forked from jlord/git-it
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixes #13 git/github its own challenge and verify gh account
- Loading branch information
Jessica Lord
committed
Jan 24, 2014
1 parent
7af9790
commit 545045d
Showing
9 changed files
with
82 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
Configure Git and GitHub. | ||
|
||
-------------------------------------------------------------------- | ||
|
||
Join the 5 million building things together on GitHub by creating an | ||
account, then configure your Git so that it knows who is doing | ||
the editing. | ||
|
||
{bold}{cyan} | ||
Create a GitHub Account{/bold} | ||
-----------------------{/cyan} | ||
|
||
GitHub is a website that alows people everywhere to share what | ||
they're working on with Git and to easily work together. | ||
|
||
- Visit {bold}http://www.github.com{/bold} and sign up for a free account. | ||
- High five, welcome! | ||
|
||
{bold}{cyan} | ||
Configure Git{/bold} | ||
-------------{/cyan} | ||
|
||
You'll want to let Git know who to associate the changes you make to | ||
by telling it your name, GitHub account name and email address. | ||
|
||
Open a new terminal {bold}(CMD + N){/bold} window and set your name: | ||
|
||
$ git config --global user.name "Your Name" | ||
|
||
Then add your GitHub username: | ||
|
||
$ git config --global user.username githubusername | ||
|
||
Now set your email: | ||
|
||
$ git config --global user.email [email protected] | ||
|
||
When you've set everything up, run `git-it verify` | ||
|
||
-------------------------------------------------------------------- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module.exports = function () { | ||
return { args: [], stdin: null } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
console.log("Username added!") | ||
console.log("Email added!") | ||
console.log("You're on GitHub!") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/usr/bin/env node | ||
|
||
var exec = require('child_process').exec | ||
var request = require('request') | ||
|
||
var url = "http://www.github.com/" | ||
|
||
// verify they set up git config | ||
|
||
exec('git config user.email', function(err, stdout, stderr) { | ||
var email = stdout.trim() | ||
exec('git config user.username', function(err, stdout, stderr) { | ||
var user = stdout.trim() | ||
if (user === "") console.error("No username found.") | ||
else { | ||
console.log("Username added!") | ||
checkGitHub(user) | ||
} | ||
if (email === "") console.error("No email found.") | ||
else console.log("Email added!") | ||
}) | ||
}) | ||
|
||
function checkGitHub(user, callback) { | ||
request(url + user + '.json', {json: true}, function (error, response, body) { | ||
if (error) return console.log(error) | ||
if (!error && response.statusCode == 200) { | ||
if (body.error) return console.log("GitHub account matching Git\n username wasn't found.") | ||
else console.log("You're on GitHub!") | ||
} | ||
}) | ||
} | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,35 +6,6 @@ | |
is handy, but makes it pretty hard to share and work with others on. | ||
No worries, that's what GitHub.com is for! | ||
|
||
{bold}{cyan} | ||
Create a GitHub Account{/bold} | ||
-----------------------{/cyan} | ||
|
||
GitHub is a website that alows people everywhere to share what | ||
they're working on with Git and to easily work together. | ||
|
||
- Visit {bold}http://www.github.com{/bold} and sign up for a free account. | ||
- High five, welcome! | ||
|
||
{bold}{cyan} | ||
Configure Git{/bold} | ||
-------------{/cyan} | ||
|
||
You'll want to let Git know who to associate the changes you make to | ||
by telling it your GitHub account name and email address. | ||
|
||
Open a new terminal {bold}(CMD + N){/bold} window and set your name: | ||
|
||
$ git config --global user.name "Your Name" | ||
|
||
Then add your GitHub username: | ||
|
||
$ git config --global user.username githubusername | ||
|
||
Now set your email: | ||
|
||
$ git config --global user.email [email protected] | ||
|
||
{bold}{cyan} | ||
Create a Remote Repository{/bold} | ||
--------------------------{/cyan} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1 @@ | ||
console.log("Bingo! Detected a push.") | ||
console.log("Username added!") | ||
console.log("Email added!") | ||
console.log("Bingo! Detected a push.") |