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.
- Loading branch information
Jessica Lord
committed
Jan 21, 2014
1 parent
70d726f
commit 2af3b4c
Showing
8 changed files
with
13 additions
and
28 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
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,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") | ||
// } | ||
}) |
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,3 @@ | ||
onsole.log("Bingo! Detected a push.") | ||
console.log("Bingo! Detected a push.") | ||
console.log("Username added!") | ||
console.log("Email added!") |
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 |
---|---|---|
@@ -1 +1 @@ | ||
console.log("Nice! Found your pull request!") | ||
console.log("Found your pull request!") |
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