Skip to content

Commit

Permalink
edit console.logs and verifies
Browse files Browse the repository at this point in the history
  • Loading branch information
Jessica Lord committed Jan 21, 2014
1 parent 70d726f commit 2af3b4c
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 28 deletions.
2 changes: 1 addition & 1 deletion problems/branches_arent_just_for_birds/verify.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ exec('git config user.username', function(err, stdout, stdrr) {

var ref = stdout.trim()
if (branch.match(branchName)) console.log("Found the branch as expected!")
else console.log("branch name was not '" + branchName + "'")
else console.log("branch name was not:\n'" + branchName + "'")

if (ref.match("update by push")) console.log("Changes have been pushed!")
else console.log("Changes not pushed")
Expand Down
2 changes: 1 addition & 1 deletion problems/commit_to_it/verify.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ function onShow(output) {
var show = output.toString().trim()
if (show.match("new file mode") && show.match("commit"))
console.log("Changes have been committed!")
else console.log("Seems no changes have been committed.")
else console.log("Seems no changes \nhave been committed.")
}
2 changes: 1 addition & 1 deletion problems/its_a_small_world/verify.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function collaborating(username) {
request(url + username, {json: true}, function (error, response, body) {
if (error) console.log(error)
if (!error && response.statusCode == 200) {
if (body.collab = true) console.log("Reporobot has been added!")
if (body.collab = true)
else console.log("Reporobot doesn't have access to the fork")
if (body.error) console.log(body)
}
Expand Down
27 changes: 6 additions & 21 deletions problems/pull_never_out_of_date/verify.js
Original file line number Diff line number Diff line change
@@ -1,28 +1,13 @@
#!/usr/bin/env node

var spawn = require('child_process').spawn
var concat = require('concat-stream')
var pull = spawn('git', ['fetch', '--dry-run'])
var exec = require('child_process').exec

// do a fetch dry run to see if there is anything
// to pull; if there is they haven't pulled yet

pull.stdout.pipe(concat(onPull))

function onPull(output) {
var status = output.toString().trim()
if (!status)
console.log("Up to date!")
exec('git fetch --dry-run', function(err, stdout, stdrr) {
if (err) return console.log("Error, unexpected response.")
var status = stdout.trim()
if (!err && status === "") console.log("Up to date!")
else console.log("There are changes to pull in.")
}

// // check they have no changes to push
//
// var status = spawn('git', ['status'])
//
// function onStatus(output) {
// var status = output.toString().trim()
// if (status.match("nothing to commit"))
// console.log(true)
// else console.log("There are changes to push")
// }
})
2 changes: 1 addition & 1 deletion problems/remote_control/solution.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
onsole.log("Bingo! Detected a push.")
console.log("Bingo! Detected a push.")
console.log("Username added!")
console.log("Email added!")
2 changes: 1 addition & 1 deletion problems/remote_control/verify.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ ref.stdout.pipe(concat(onRef))
function onRef(output) {
var ref = output.toString().trim()
if (ref.match("update by push")) console.log("Bingo! Detected a push.")
else console.log("No evidence of a push, please try again!")
else console.log("No evidence of push.")
}

// verify they set up git config
Expand Down
2 changes: 1 addition & 1 deletion problems/requesting_you_pull_please/solution.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
console.log("Nice! Found your pull request!")
console.log("Found your pull request!")
2 changes: 1 addition & 1 deletion problems/requesting_you_pull_please/verify.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function pullrequest(username) {
request(url + username, {json: true}, function (error, response, body) {
if (!error && response.statusCode == 200) {
var pr = body.pr
if (pr) console.log("Nice! Found your pull request!")
if (pr) console.log("Found your pull request!")
else console.log("No pull request found for " + username)
}
})
Expand Down

0 comments on commit 2af3b4c

Please sign in to comment.