Skip to content

Commit e96e2f6

Browse files
committed
[fix] changed git clone to use ssh urls since I was getting 403 errors from the http links
1 parent fecc581 commit e96e2f6

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

app.js

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ var flatiron = require('flatiron'),
88
github = require('octonode'),
99
util = require('util'),
1010
exec = require('child_process').exec,
11-
username = 'XXXXXXXXXXXX',
12-
password = 'XXXXXXXXXXXX!',
11+
username = 'XXXXXXXXXXXXX',
12+
password = 'XXXXXXXXXXXXX',
1313
app = flatiron.app;
1414

1515

@@ -98,7 +98,7 @@ function forkAndFix(link, cb){
9898
notifyAvailability(forkedRepo, username, repo, repoLocation, status, callback);
9999
},//,// wait for availability (whilst)
100100
function (status, callback){
101-
cloneRepo(forkedRepo, repoLocation, status, callback);
101+
cloneRepo(repo, forkedRepo, repoLocation, status, callback);
102102
},// clone repo
103103
function (status, callback){
104104
switchBranch(forkedRepo, repoLocation, status, callback);
@@ -122,6 +122,7 @@ function forkAndFix(link, cb){
122122
}
123123
app.log.info('node-migrator-bot '.grey+result);
124124
app.log.info('Done with '+link.blue.bold);
125+
return cb(null, result);
125126
});
126127
}
127128

@@ -164,7 +165,7 @@ function submitPullRequest( username, user, repo, status, cb){
164165
'that will make changes to your code to hopefully fix the issue that '+
165166
'arises when you have require(\'sys\') in your code when running against '+
166167
'v 0.8+ versions of node. I will change your code to reflect the proper'+
167-
' library \'util\'.\n\nIf you would like to see more take a look at '+
168+
' library \'util\'.\n\nIf you would like to know more take a look at '+
168169
'https://github.com/joyent/node/commit/1582cf#L1R51 or '+
169170
'https://github.com/joyent/node/blob/1582cfebd6719b2d2373547994b3dca5c8c569c0/ChangeLog#L51'+
170171
'\n\nThanks!\nYour Friendly Neighborhood '+
@@ -217,9 +218,11 @@ function submitPullRequest( username, user, repo, status, cb){
217218
});
218219
}
219220

220-
function cloneRepo(forkedRepo, repoLocation, status, cb){
221+
function cloneRepo(repo, forkedRepo, repoLocation, status, cb){
221222
app.log.info("Attempting to clone "+ forkedRepo.blue.bold);
222-
var cmd = 'git clone '+forkedRepo+' "'+repoLocation+'"';
223+
//ssh git@github.com:username/repo.git
224+
//var cmd = 'git clone '+forkedRepo+'.git "'+repoLocation+'"';
225+
var cmd = 'git clone git@github.com:'+username+'/'+repo+'.git "'+repoLocation+'"';
223226
app.log.debug('calling: "'+cmd.grey+'"');
224227
var child = exec(cmd,
225228
function (error, stdout, stderr) {
@@ -299,11 +302,12 @@ function pushCommit(forkedRepo, repoLocation, status, cb){
299302
app.log.debug('calling: "'+cmd.grey+'"');
300303
var child = exec(cmd,
301304
function (error, stdout, stderr) {
302-
app.log.debug('stdout: ' + stdout);
303-
app.log.debug('stderr: ' + stderr);
304305
if (error !== null) {
306+
console.dir(error);
305307
app.log.debug('stdout: ' + stdout);
308+
console.dir(stdout);
306309
app.log.debug('stderr: ' + stderr);
310+
console.dir(stdout);
307311
return cb(error);
308312
}else{
309313
app.log.info(forkedRepo.blue.bold+'@'+repoLocation.yellow.bold+':clean branch '+'COMMIT PUSHED'.green.bold);

0 commit comments

Comments
 (0)