Skip to content

Commit 21c383d

Browse files
committed
fix linter
1 parent 12c0e5e commit 21c383d

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

examples/cloneFromGithubWith2Factor.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ var token = "{Your GitHub user token}";
77
var repoOwner = "{The orgname or username that owns the repo}";
88
var repoName = "{The name of the repo}";
99

10+
// To clone with 2 factor auth enabled, you have to use a github oauth token
11+
// over https, it can't be done with actual 2 factor.
12+
// https://github.com/blog/1270-easier-builds-and-deployments-using-git-over-https-and-oauth
13+
1014
// The token has to be included in the URL if the repo is private.
1115
// Otherwise, github just wont respond, so a normal credential callback
1216
// wont work.
@@ -24,14 +28,12 @@ var opts = {
2428
ignoreCertErrors: 1,
2529
remoteCallbacks: {
2630
credentials: function() {
27-
return NodeGit.Cred.userpassPlaintextNew (token, "x-oauth-basic");
31+
return nodegit.Cred.userpassPlaintextNew (token, "x-oauth-basic");
2832
}
2933
}
30-
}
34+
};
3135

3236
fse.remove(path).then(function() {
33-
var entry;
34-
3537
nodegit.Clone.clone(repoUrl, path, opts)
3638
.done(function(repo) {
3739
if (repo instanceof nodegit.Repository) {

0 commit comments

Comments
 (0)