Skip to content

Commit 149c536

Browse files
committed
moving some deps to devdeps
1 parent a0083b9 commit 149c536

2 files changed

Lines changed: 28 additions & 25 deletions

File tree

install.js

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
var os = require("os");
22
var path = require("path");
33
var zlib = require("zlib");
4-
var tar = require("tar");
4+
var tar;
5+
var request;
56

67
var Promise = require("nodegit-promise");
78
var promisify = require("promisify-node");
8-
var request = require("request");
99
var fse = promisify(require("fs-extra"));
1010
var findParentDir = promisify(require('find-parent-dir'));
1111
fse.ensureDir = promisify(fse.ensureDir, function() { return true; });
@@ -14,6 +14,7 @@ var exec = promisify(function(command, opts, callback) {
1414
return require("child_process").exec(command, opts, callback);
1515
});
1616

17+
1718
var NODE_VERSION = Number(process.version.match(/^v(\d+\.\d+)/)[1]);
1819

1920
// If the build only flag is set.
@@ -96,17 +97,23 @@ function compile(err) {
9697
console.info("[nodegit] Failed to install prebuilt, attempting compile.");
9798
}
9899

99-
console.info("[nodegit] Determining dependencies.");
100-
101-
return Promise.all([
102-
python(),
103-
getVendorLib("libgit2", "https://github.com/libgit2/libgit2/tarball/" + pkg.libgit2.sha),
104-
getVendorLib("libssh2", pkg.libssh2.url),
105-
getVendorLib("http_parser", pkg.http_parser.url),
106-
guardGenerated()
107-
])
108-
.then(buildNative)
109-
.then(finish, fail);
100+
tar = require("tar");
101+
request = require("request");
102+
103+
console.info("[nodegit] Installing all devDependencies");
104+
return exec("npm install --ignore-scripts --dont-prepublish")
105+
.then(function() {
106+
console.info("[nodegit] Determining source dependencies.");
107+
return Promise.all([
108+
python(),
109+
getVendorLib("libgit2", "https://github.com/libgit2/libgit2/tarball/" + pkg.libgit2.sha),
110+
getVendorLib("libssh2", pkg.libssh2.url),
111+
getVendorLib("http_parser", pkg.http_parser.url),
112+
guardGenerated()
113+
]);
114+
})
115+
.then(buildNative)
116+
.then(finish, fail);
110117
}
111118

112119
function python() {
@@ -187,11 +194,7 @@ function guardGenerated() {
187194
return Promise.resolve();
188195
}, function() {
189196
console.info("[nodegit] C++ files not found, generating now.");
190-
console.info("[nodegit] Installing all devDependencies");
191-
return exec("npm install --ignore-scripts --dont-prepublish")
192-
.then(function() {
193-
return exec("node generate");
194-
});
197+
return exec("node generate");
195198
});
196199
}
197200

package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,22 +62,22 @@
6262
"dependencies": {
6363
"find-parent-dir": "^0.3.0",
6464
"fs-extra": "^0.12.0",
65-
"nan": "~1.3.0",
66-
"node-gyp": "~1.0.2",
6765
"node-pre-gyp": "~0.5.27",
6866
"nodegit-promise": "~1.0.0",
69-
"nw-gyp": "^0.12.4",
70-
"promisify-node": "~0.1.2",
71-
"request": "~2.45.0",
72-
"tar": "~1.0.1"
67+
"promisify-node": "~0.1.2"
7368
},
7469
"devDependencies": {
7570
"mocha": "~1.21.4",
7671
"combyne": "~0.6.2",
7772
"istanbul": "~0.3.2",
7873
"js-beautify": "^1.5.4",
7974
"jshint": "~2.5.6",
80-
"lodash": "^2.4.1"
75+
"lodash": "^2.4.1",
76+
"nan": "~1.3.0",
77+
"node-gyp": "~1.0.2",
78+
"nw-gyp": "^0.12.4",
79+
"request": "~2.45.0",
80+
"tar": "~1.0.1"
8181
},
8282
"binary": {
8383
"module_name": "nodegit",

0 commit comments

Comments
 (0)