Skip to content

Commit 6473261

Browse files
tbranyenJohn Haley
authored andcommitted
Minor style tweaks to guides
1 parent 475d6e1 commit 6473261

File tree

4 files changed

+26
-29
lines changed

4 files changed

+26
-29
lines changed

guides/cloning/gh-two-factor/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ In the guides directory, we like to keep our NodeGit relative to the project
2020
root.
2121

2222
``` javascript
23-
var Git = require('../../../');
23+
var Git = require("../../../");
2424
```
2525

2626
However, in your project you will most likely be using the following command:
2727

2828
``` javascript
29-
var Git = require('nodegit');
29+
var Git = require("nodegit");
3030
```
3131

3232
### Clone URL
@@ -38,7 +38,7 @@ You could easily substitute this with any valid http or https Git repository
3838
URL.
3939

4040
``` javascript
41-
var cloneURL = 'https://github.com/nodegit/test';
41+
var cloneURL = "https://github.com/nodegit/test";
4242
```
4343

4444
### Clone path
@@ -52,7 +52,7 @@ current working directory in NodeGit, so you will need to normalize it first.
5252
This is very simple in Node:
5353

5454
``` javascript
55-
var localPath = require('path').join(__dirname, 'tmp');
55+
var localPath = require("path").join(__dirname, "tmp");
5656
```
5757

5858
Now this `tmp` directory will be created along side your script, no matter how
@@ -120,7 +120,7 @@ and work with the `Git.Repository` instance result.
120120
cloneRepository.catch(errorAndAttemptOpen)
121121
.then(function(repository) {
122122
// Access any repository methods here.
123-
console.log('Is the repository bare? %s', Boolean(repository.isBare()));
123+
console.log("Is the repository bare? %s", Boolean(repository.isBare()));
124124
});
125125
```
126126

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
// Require in NodeGit, since we want to use the local copy, we're using a
1+
// Require in NodeGit, since we want to use the local copy, we"re using a
22
// relative path. In your project, you will use:
33
//
4-
// var NodeGit = require('nodegit');
5-
var Git = require('../../../');
4+
// var NodeGit = require("nodegit");
5+
var Git = require("../../../");
66

77
// To clone with two factor auth enabled, you have to use a GitHub OAuth token
88
// over HTTPS.
9-
var GITHUB_TOKEN = '<GH_TOKEN>';
9+
var GITHUB_TOKEN = "<GH_TOKEN>";
1010

1111
// Using the `clone` method from the `Git.Clone` module, bring down the NodeGit
1212
// test repository from GitHub.
13-
var cloneURL = 'https://github.com/nodegit/private';
13+
var cloneURL = "https://github.com/nodegit/private";
1414

1515
// Ensure that the `tmp` directory is local to this file and not the CWD.
16-
var localPath = require('path').join(__dirname, 'tmp');
16+
var localPath = require("path").join(__dirname, "tmp");
1717

1818
// Simple object to store clone options.
1919
var cloneOptions = {};
@@ -23,12 +23,12 @@ var cloneOptions = {};
2323
cloneOptions.remoteCallbacks = {
2424
certificateCheck: function() { return 1; },
2525
credentials: function() {
26-
return Git.Cred.userpassPlaintextNew(GITHUB_TOKEN, 'x-oauth-basic');
26+
return Git.Cred.userpassPlaintextNew(GITHUB_TOKEN, "x-oauth-basic");
2727
}
2828
};
2929

3030
// Invoke the clone operation and store the returned Promise.
31-
var cloneRepository = Git.Clone.clone(cloneURL, localPath, cloneOptions);
31+
var cloneRepository = Git.Clone(cloneURL, localPath, cloneOptions);
3232

3333
// If the repository already exists, the clone above will fail. You can simply
3434
// open the repository in this case to continue execution.
@@ -41,8 +41,5 @@ var errorAndAttemptOpen = function() {
4141
cloneRepository.catch(errorAndAttemptOpen)
4242
.then(function(repository) {
4343
// Access any repository methods here.
44-
console.log('Is the repository bare? %s', Boolean(repository.isBare()));
45-
})
46-
.catch(function(ex) {
47-
console.log(ex, ex.stack);
44+
console.log("Is the repository bare? %s", Boolean(repository.isBare()));
4845
});

guides/cloning/http/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ In the guides directory, we like to keep our NodeGit relative to the project
2424
root.
2525

2626
``` javascript
27-
var Git = require('../../../');
27+
var Git = require("../../../");
2828
```
2929

3030
However, in your project you will most likely be using the following command:
3131

3232
``` javascript
33-
var Git = require('nodegit');
33+
var Git = require("nodegit");
3434
```
3535

3636
### Clone URL
@@ -42,7 +42,7 @@ You could easily substitute this with any valid http or https Git repository
4242
URL.
4343

4444
``` javascript
45-
var cloneURL = 'https://github.com/nodegit/test';
45+
var cloneURL = "https://github.com/nodegit/test";
4646
```
4747

4848
### Clone path
@@ -56,7 +56,7 @@ current working directory in NodeGit, so you will need to normalize it first.
5656
This is very simple in Node:
5757

5858
``` javascript
59-
var localPath = require('path').join(__dirname, 'tmp');
59+
var localPath = require("path").join(__dirname, "tmp");
6060
```
6161

6262
Now this `tmp` directory will be created along side your script, no matter how
@@ -124,6 +124,6 @@ and work with the `Git.Repository` instance result.
124124
cloneRepository.catch(errorAndAttemptOpen)
125125
.then(function(repository) {
126126
// Access any repository methods here.
127-
console.log('Is the repository bare? %s', Boolean(repository.isBare()));
127+
console.log("Is the repository bare? %s", Boolean(repository.isBare()));
128128
});
129129
```

guides/cloning/http/index.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
// Require in NodeGit, since we want to use the local copy, we're using a
1+
// Require in NodeGit, since we want to use the local copy, we"re using a
22
// relative path. In your project, you will use:
33
//
4-
// var NodeGit = require('nodegit');
5-
var Git = require('../../../');
4+
// var NodeGit = require("nodegit");
5+
var Git = require("../../../");
66

77
// Using the `clone` method from the `Git.Clone` module, bring down the NodeGit
88
// test repository from GitHub.
9-
var cloneURL = 'https://github.com/nodegit/test';
9+
var cloneURL = "https://github.com/nodegit/test";
1010

1111
// Ensure that the `tmp` directory is local to this file and not the CWD.
12-
var localPath = require('path').join(__dirname, 'tmp');
12+
var localPath = require("path").join(__dirname, "tmp");
1313

1414
// Simple object to store clone options.
1515
var cloneOptions = {};
@@ -21,7 +21,7 @@ cloneOptions.remoteCallbacks = {
2121
};
2222

2323
// Invoke the clone operation and store the returned Promise.
24-
var cloneRepository = Git.Clone.clone(cloneURL, localPath, cloneOptions);
24+
var cloneRepository = Git.Clone(cloneURL, localPath, cloneOptions);
2525

2626
// If the repository already exists, the clone above will fail. You can simply
2727
// open the repository in this case to continue execution.
@@ -34,5 +34,5 @@ var errorAndAttemptOpen = function() {
3434
cloneRepository.catch(errorAndAttemptOpen)
3535
.then(function(repository) {
3636
// Access any repository methods here.
37-
console.log('Is the repository bare? %s', Boolean(repository.isBare()));
37+
console.log("Is the repository bare? %s", Boolean(repository.isBare()));
3838
});

0 commit comments

Comments
 (0)