Skip to content

Commit cf2cd8f

Browse files
committed
fix linting in lifecyclescripts
1 parent 20c6566 commit cf2cd8f

5 files changed

Lines changed: 37 additions & 29 deletions

File tree

lifecycleScripts/checkPrepared.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ function checkVendor(name, skipVersion) {
4545
var vendorPath = "vendor/" + name + "/" + version;
4646
return checkExists(vendorPath);
4747
}
48-
module.exports.checkVendor = checkVendor
48+
module.exports.checkVendor = checkVendor;
4949

5050
function checkGenerated() {
5151
return Promise.all([

lifecycleScripts/clean.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
var fse = require("fs-extra");
22
var path = require("path");
3-
var cp = require("child_process");
43
var npm = require("npm");
54
var Promise = require("nodegit-promise");
65

76
var rooted = path.join.bind(path, __dirname, "..");
87
if (fse.existsSync(rooted(".didntcomefromthenpmregistry"))) {
9-
console.error("[nodegit] We only clean when downloaded from the npm registry. Skipping clean.");
8+
console.error("[nodegit] We only clean when downloaded from the npm " +
9+
"registry. Skipping clean.");
1010
return;
1111
}
1212

@@ -86,10 +86,11 @@ npm.load({
8686
var failures = filesToDelete.some(function(deletable) {
8787
try {
8888
fse.removeSync(rooted(deletable));
89-
return false
89+
return false;
9090
}
9191
catch (e) {
92-
console.info("[nodegit] Error deleting files. Errored on " + rooted(deletable)) + ".";
92+
console.info("[nodegit] Error deleting files. Errored on " +
93+
rooted(deletable) + ".");
9394
console.error(e);
9495

9596
reject(e);

lifecycleScripts/install.js

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ var path = require("path");
44
var fs = require("fs");
55

66
var local = path.join.bind(path, __dirname);
7-
var pkg = require(local("../package"));
8-
var cp = require("child_process");
97

108
var checkPrepared = require(local("checkPrepared"));
119
var forNodeWebkit = require("for-node-webkit");
@@ -42,23 +40,26 @@ return forNodeWebkit(local(".."))
4240
console.info("[nodegit] Completed installation successfully.");
4341
},
4442
function() {
45-
console.info("[nodegit] Failed to install prebuilt binary, building manually.");
43+
console.info("[nodegit] Failed to install prebuilt binary, " +
44+
"building manually.");
4645
return checkAndBuild();
4746
}
4847
);
4948
});
5049

5150

5251
function checkAndBuild(nwVersion) {
53-
console.info("[nodegit] Making sure dependencies are available and native code is generated");
52+
console.info("[nodegit] Making sure dependencies are available and native " +
53+
"code is generated");
5454

5555
return checkPrepared.checkAll()
5656
.then(function(allGood) {
5757
if (allGood) {
5858
return Promise.resolve();
5959
}
6060
else {
61-
console.info("[nodegit] Something is missing, retrieving dependencies and regenerating code");
61+
console.info("[nodegit] Something is missing, retrieving " +
62+
"dependencies and regenerating code");
6263
return prepareForBuild();
6364
}
6465
})
@@ -84,11 +85,11 @@ function build(nwVersion) {
8485
var builder = nwVersion ? "nw-gyp" : "node-gyp";
8586
var target = (nwVersion ? "--target=\"" + nwVersion + "\"": "");
8687
var debug = (process.env.BUILD_DEBUG ? " --debug" : "");
87-
var cmd = path.resolve(".", "node_modules", ".bin", builder)
88-
+ " clean configure"
89-
+ debug
90-
+ target
91-
+ " build";
88+
var cmd = path.resolve(".", "node_modules", ".bin", builder) +
89+
" clean configure" +
90+
debug +
91+
target +
92+
" build";
9293

9394
return exec(cmd, opts)
9495
.then(function() {

lifecycleScripts/prepareForBuild.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ module.exports = function prepareForBuild() {
2020
resolve();
2121
console.info(stdout);
2222
}
23-
})
23+
});
2424
}).then(function() {
2525
return Promise.all([
2626
retrieve(),
@@ -37,7 +37,8 @@ function doGenerate() {
3737
return Promise.resolve();
3838
}
3939
else {
40-
console.info("[nodegit] Generated code is missing or incomplete, regenerating now.");
40+
console.info("[nodegit] Generated code is missing or incomplete, " +
41+
"regenerating now.");
4142

4243
return new Promise(function(resolve, reject) {
4344
try {
@@ -51,7 +52,7 @@ function doGenerate() {
5152
//console.info(stderr);
5253
reject(e);
5354
}
54-
})
55+
});
5556
}
5657
});
5758
}

lifecycleScripts/retrieveExternalDependencies.js

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ module.exports = function retrieveExternalDependencies() {
2222
getVendorLib("libgit2"),
2323
getVendorLib("libssh2"),
2424
getVendorLib("http_parser")
25-
])
25+
]);
2626
};
2727

2828

@@ -78,24 +78,29 @@ function getVendorLib(name) {
7878
if ((name == "libssh2") && (process.platform !== "win32")) {
7979
return new Promise(function(resolve, reject) {
8080
console.info("[nodegit] Configuring libssh2.");
81-
cp.exec(rooted(vendorPath) + "configure", {cwd: rooted(vendorPath)}, function(err, stdout, stderr) {
82-
if (err) {
83-
console.error(err);
84-
console.error(stderr);
85-
reject(err, stderr);
81+
cp.exec(
82+
rooted(vendorPath) + "configure",
83+
{cwd: rooted(vendorPath)},
84+
function(err, stdout, stderr) {
85+
if (err) {
86+
console.error(err);
87+
console.error(stderr);
88+
reject(err, stderr);
89+
}
90+
else {
91+
resolve(stdout);
92+
}
8693
}
87-
else {
88-
resolve(stdout);
89-
}
90-
})
94+
);
9195
});
9296
}
9397
else {
9498
return Promise.resolve();
9599
}
96100
})
97101
.then(function() {
98-
console.info("[nodegit] Successfully updated " + vendorPath + version + ".");
102+
console.info("[nodegit] Successfully updated " + vendorPath +
103+
version + ".");
99104
});
100105
}
101106
});

0 commit comments

Comments
 (0)