| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -45,7 +45,7 @@ function checkVendor(name, skipVersion) { | |||
| 45 | 45 | var vendorPath = "vendor/" + name + "/" + version; | |
| 46 | 46 | return checkExists(vendorPath); | |
| 47 | 47 | } | |
| 48 | - module.exports.checkVendor = checkVendor | ||
| 48 | + module.exports.checkVendor = checkVendor; | ||
| 49 | 49 | ||
| 50 | 50 | function checkGenerated() { | |
| 51 | 51 | return Promise.all([ | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,12 +1,12 @@ | |||
| 1 | 1 | var fse = require("fs-extra"); | |
| 2 | 2 | var path = require("path"); | |
| 3 | - var cp = require("child_process"); | ||
| 4 | 3 | var npm = require("npm"); | |
| 5 | 4 | var Promise = require("nodegit-promise"); | |
| 6 | 5 | ||
| 7 | 6 | var rooted = path.join.bind(path, __dirname, ".."); | |
| 8 | 7 | 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."); | ||
| 10 | 10 | return; | |
| 11 | 11 | } | |
| 12 | 12 | ||
@@ -86,10 +86,11 @@ npm.load({ | |||
| 86 | 86 | var failures = filesToDelete.some(function(deletable) { | |
| 87 | 87 | try { | |
| 88 | 88 | fse.removeSync(rooted(deletable)); | |
| 89 | - return false | ||
| 89 | + return false; | ||
| 90 | 90 | } | |
| 91 | 91 | 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) + "."); | ||
| 93 | 94 | console.error(e); | |
| 94 | 95 | ||
| 95 | 96 | reject(e); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -4,8 +4,6 @@ var path = require("path"); | |||
| 4 | 4 | var fs = require("fs"); | |
| 5 | 5 | ||
| 6 | 6 | var local = path.join.bind(path, __dirname); | |
| 7 | - var pkg = require(local("../package")); | ||
| 8 | - var cp = require("child_process"); | ||
| 9 | 7 | ||
| 10 | 8 | var checkPrepared = require(local("checkPrepared")); | |
| 11 | 9 | var forNodeWebkit = require("for-node-webkit"); | |
@@ -42,23 +40,26 @@ return forNodeWebkit(local("..")) | |||
| 42 | 40 | console.info("[nodegit] Completed installation successfully."); | |
| 43 | 41 | }, | |
| 44 | 42 | function() { | |
| 45 | - console.info("[nodegit] Failed to install prebuilt binary, building manually."); | ||
| 43 | + console.info("[nodegit] Failed to install prebuilt binary, " + | ||
| 44 | + "building manually."); | ||
| 46 | 45 | return checkAndBuild(); | |
| 47 | 46 | } | |
| 48 | 47 | ); | |
| 49 | 48 | }); | |
| 50 | 49 | ||
| 51 | 50 | ||
| 52 | 51 | 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"); | ||
| 54 | 54 | ||
| 55 | 55 | return checkPrepared.checkAll() | |
| 56 | 56 | .then(function(allGood) { | |
| 57 | 57 | if (allGood) { | |
| 58 | 58 | return Promise.resolve(); | |
| 59 | 59 | } | |
| 60 | 60 | 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"); | ||
| 62 | 63 | return prepareForBuild(); | |
| 63 | 64 | } | |
| 64 | 65 | }) | |
@@ -84,11 +85,11 @@ function build(nwVersion) { | |||
| 84 | 85 | var builder = nwVersion ? "nw-gyp" : "node-gyp"; | |
| 85 | 86 | var target = (nwVersion ? "--target=\"" + nwVersion + "\"": ""); | |
| 86 | 87 | 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"; | ||
| 92 | 93 | ||
| 93 | 94 | return exec(cmd, opts) | |
| 94 | 95 | .then(function() { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -20,7 +20,7 @@ module.exports = function prepareForBuild() { | |||
| 20 | 20 | resolve(); | |
| 21 | 21 | console.info(stdout); | |
| 22 | 22 | } | |
| 23 | - }) | ||
| 23 | + }); | ||
| 24 | 24 | }).then(function() { | |
| 25 | 25 | return Promise.all([ | |
| 26 | 26 | retrieve(), | |
@@ -37,7 +37,8 @@ function doGenerate() { | |||
| 37 | 37 | return Promise.resolve(); | |
| 38 | 38 | } | |
| 39 | 39 | 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."); | ||
| 41 | 42 | ||
| 42 | 43 | return new Promise(function(resolve, reject) { | |
| 43 | 44 | try { | |
@@ -51,7 +52,7 @@ function doGenerate() { | |||
| 51 | 52 | //console.info(stderr); | |
| 52 | 53 | reject(e); | |
| 53 | 54 | } | |
| 54 | - }) | ||
| 55 | + }); | ||
| 55 | 56 | } | |
| 56 | 57 | }); | |
| 57 | 58 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -22,7 +22,7 @@ module.exports = function retrieveExternalDependencies() { | |||
| 22 | 22 | getVendorLib("libgit2"), | |
| 23 | 23 | getVendorLib("libssh2"), | |
| 24 | 24 | getVendorLib("http_parser") | |
| 25 | - ]) | ||
| 25 | + ]); | ||
| 26 | 26 | }; | |
| 27 | 27 | ||
| 28 | 28 | ||
@@ -78,24 +78,29 @@ function getVendorLib(name) { | |||
| 78 | 78 | if ((name == "libssh2") && (process.platform !== "win32")) { | |
| 79 | 79 | return new Promise(function(resolve, reject) { | |
| 80 | 80 | 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 | + } | ||
| 86 | 93 | } | |
| 87 | - else { | ||
| 88 | - resolve(stdout); | ||
| 89 | - } | ||
| 90 | - }) | ||
| 94 | + ); | ||
| 91 | 95 | }); | |
| 92 | 96 | } | |
| 93 | 97 | else { | |
| 94 | 98 | return Promise.resolve(); | |
| 95 | 99 | } | |
| 96 | 100 | }) | |
| 97 | 101 | .then(function() { | |
| 98 | - console.info("[nodegit] Successfully updated " + vendorPath + version + "."); | ||
| 102 | + console.info("[nodegit] Successfully updated " + vendorPath + | ||
| 103 | + version + "."); | ||
| 99 | 104 | }); | |
| 100 | 105 | } | |
| 101 | 106 | }); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments