Skip to content

Commit bfe3df4

Browse files
committed
cli removed
1 parent 7db1916 commit bfe3df4

File tree

3 files changed

+19
-25
lines changed

3 files changed

+19
-25
lines changed

cmake/BoostLib.cmake

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,15 @@ function(require_boost_libs req_boost_version req_boost_libs)
1111
string(REGEX MATCH "^[0-9]+\\.[0-9]+\\.[0-9]+$" m "${req_boost_version}")
1212
if(NOT m STREQUAL "")
1313
find_package(Boost "${req_boost_version}" COMPONENTS "${req_boost_libs}")
14-
if(Boost_FOUND)
15-
message(STATUS "Boost package found.")
16-
else(Boost_FOUND)
17-
boost_lib_installer("${req_boost_version}" "${req_boost_libs}")
18-
message(STATUS "Boost installed.")
19-
endif(Boost_FOUND)
2014
endif()
2115

16+
if(Boost_FOUND)
17+
message(STATUS "Boost package found.")
18+
else(Boost_FOUND)
19+
boost_lib_installer("${req_boost_version}" "${req_boost_libs}")
20+
message(STATUS "Boost installed.")
21+
endif(Boost_FOUND)
22+
2223
message(STATUS "Boost Include dirs: ${Boost_INCLUDE_DIRS}")
2324
message(STATUS "Boost Libraries: ${Boost_LIBRARIES}")
2425

lib/boostDownloader.js

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ var fs = Bluebird.promisifyAll(require("fs-extra"));
66
var semver = require("semver");
77
var path = require("path");
88
var environment = cmakejs.environment;
9-
var cli = require("cli");
109
var zlib = require("zlib");
1110
var tar = require("tar");
1211
var request = require("request");
12+
var exec = require('child_process').exec;
1313

1414
function downloadTo(url, result) {
1515
return new Bluebird(function (resolve, reject) {
@@ -99,8 +99,13 @@ BoostDownloader.prototype._download = function () {
9999
self.log.verbose("BOOST", "Getting Boost releases.");
100100
var command = "git ls-remote --tags https://github.com/boostorg/boost.git";
101101
return new Bluebird(function (resolve, reject) {
102-
cli.exec(command,
103-
function (output) {
102+
exec(command, function(err, stdout, stderr) {
103+
if (err) {
104+
reject(err);
105+
return;
106+
}
107+
if (stdout) {
108+
var output = stdout.split("\n");
104109
var downloadVersion = null;
105110
if (output && output.length) {
106111
output.reverse();
@@ -125,22 +130,11 @@ BoostDownloader.prototype._download = function () {
125130
.catch(function (e) {
126131
reject(e);
127132
});
128-
}
129-
else {
130-
reject(new Error("No releases found."));
131-
}
132-
},
133-
function (err, output) {
134-
if (err instanceof Error) {
135-
reject(new Error(err.message + (output ? ("\n" + output) : "")));
136133
return;
137134
}
138-
if (_.isArray(output) && output.length || err && err.message) {
139-
reject(new Error("Git exec error: " + err.message || err));
140-
return;
141-
}
142-
reject(new Error("Git exec error."));
143-
});
135+
}
136+
reject(new Error("No releases found."));
137+
});
144138
});
145139
};
146140

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@
2828
},
2929
"dependencies": {
3030
"bluebird": "^2.9.15",
31-
"cli": "^0.6.5",
32-
"cmake-js": "^0.10.1",
31+
"cmake-js": "^0.10.2",
3332
"debug": "^2.1.3",
3433
"fs-extra": "^0.16.5",
3534
"lodash": "^3.6.0",

0 commit comments

Comments
 (0)