diff options
author | Samy Pessé <samypesse@gmail.com> | 2015-09-15 14:21:27 +0200 |
---|---|---|
committer | Samy Pessé <samypesse@gmail.com> | 2015-09-15 14:21:27 +0200 |
commit | 6732957e42350b3aefa4b1c80371baea92950651 (patch) | |
tree | 1605473bf22c7e4ab90a6cc9bebf5cb807fa1d90 /lib/utils/git.js | |
parent | 5f56098ae7fae80a4dd75a944c38201560b480c6 (diff) | |
parent | 1fd00068595dfced5a0f16ac05ae2553d09608bc (diff) | |
download | gitbook-6732957e42350b3aefa4b1c80371baea92950651.zip gitbook-6732957e42350b3aefa4b1c80371baea92950651.tar.gz gitbook-6732957e42350b3aefa4b1c80371baea92950651.tar.bz2 |
Merge pull request #930 from GitbookIO/jshint
Add config for jshint and fix lint errors
Diffstat (limited to 'lib/utils/git.js')
-rw-r--r-- | lib/utils/git.js | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/utils/git.js b/lib/utils/git.js index 6eb9681..e93c8f2 100644 --- a/lib/utils/git.js +++ b/lib/utils/git.js @@ -1,7 +1,5 @@ var Q = require("q"); var _ = require("lodash"); -var url = require("url"); -var tmp = require("tmp"); var path = require("path"); var crc = require("crc"); var exec = Q.denodeify(require("child_process").exec); @@ -102,11 +100,11 @@ function resolveFileFromGit(giturl) { // Resolve relative path return path.resolve(repo, giturl.filepath); }); -}; +} // Return root of git repo from a filepath function resolveGitRoot(filepath) { - var relativeToGit, repoId + var relativeToGit, repoId; // No git repo cloned, or file is not in a git repository if (!GIT_TMP || !pathUtil.isInRoot(GIT_TMP, filepath)) return null; @@ -118,7 +116,7 @@ function resolveGitRoot(filepath) { // Return an absolute file return path.resolve(GIT_TMP, repoId); -}; +} module.exports = { |