| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 39e5fa9 commit 5119bb9
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -8,7 +8,7 @@ var rootPath = path.join(__dirname, ".."); | |||
| 8 | 8 | ||
| 9 | 9 | function printStandardLibError() { | |
| 10 | 10 | console.log( | |
| 11 | - "[ERROR] Seems like the latest libstdc++ is missing on your system!" | ||
| 11 | + "[nodegit] ERROR - the latest libstdc++ is missing on your system!" | ||
| 12 | 12 | ); | |
| 13 | 13 | console.log(""); | |
| 14 | 14 | console.log("On Ubuntu you can install it using:"); | |
@@ -19,14 +19,40 @@ function printStandardLibError() { | |||
| 19 | 19 | } | |
| 20 | 20 | ||
| 21 | 21 | module.exports = function install() { | |
| 22 | + if (buildFlags.isGitRepo) { | ||
| 23 | + // If we're building NodeGit from a git repo we aren't going to do any | ||
| 24 | + // cleaning up | ||
| 25 | + return Promise.resolve(); | ||
| 26 | + } | ||
| 27 | + | ||
| 22 | 28 | return exec("node dist/nodegit.js") | |
| 29 | + .catch(function(e) { | ||
| 30 | + if (~e.toString().indexOf("Module version mismatch")) { | ||
| 31 | + console.warn( | ||
| 32 | + "[nodegit] WARN - NodeGit was built for a different version of node." | ||
| 33 | + ); | ||
| 34 | + console.warn( | ||
| 35 | + "If you are building NodeGit for electron/nwjs you can " + | ||
| 36 | + "ignore this warning." | ||
| 37 | + ); | ||
| 38 | + } | ||
| 39 | + else { | ||
| 40 | + throw e; | ||
| 41 | + } | ||
| 42 | + }) | ||
| 23 | 43 | .then(function() { | |
| 24 | 44 | // Is we're using NodeGit from a package manager then let's clean up after | |
| 25 | 45 | // ourselves when we install successfully. | |
| 26 | 46 | if (!buildFlags.mustBuild) { | |
| 27 | - fse.removeSync(path.join(rootPath, "vendor")); | ||
| 28 | - fse.removeSync(path.join(rootPath, "src")); | ||
| 29 | - fse.removeSync(path.join(rootPath, "include")); | ||
| 47 | + // We can't remove the source files yet because apparently the | ||
| 48 | + // "standard workflow" for native node moduels in Electron/nwjs is to | ||
| 49 | + // build them for node and then nah eff that noise let's rebuild them | ||
| 50 | + // again for the actual platform! Hurray!!! When that madness is dead | ||
| 51 | + // we can clean up the source which is a serious amount of data. | ||
| 52 | + // fse.removeSync(path.join(rootPath, "vendor")); | ||
| 53 | + // fse.removeSync(path.join(rootPath, "src")); | ||
| 54 | + // fse.removeSync(path.join(rootPath, "include")); | ||
| 55 | + | ||
| 30 | 56 | fse.removeSync(path.join(rootPath, "build/Release/*.a")); | |
| 31 | 57 | fse.removeSync(path.join(rootPath, "build/Release/obj.target")); | |
| 32 | 58 | } | |
@@ -39,11 +65,14 @@ if (require.main === module) { | |||
| 39 | 65 | .catch(function(e) { | |
| 40 | 66 | console.error("[nodegit] ERROR - Could not finish postinstall"); | |
| 41 | 67 | ||
| 42 | - if (process.pladtform !== "linux" && ~e.indexOf("libstdc++")) { | ||
| 68 | + if ( | ||
| 69 | + process.pladtform === "linux" && | ||
| 70 | + ~e.toString().indexOf("libstdc++") | ||
| 71 | + ) { | ||
| 43 | 72 | printStandardLibError(); | |
| 44 | 73 | } | |
| 45 | 74 | else { | |
| 46 | - console.error(e); | ||
| 75 | + console.log(e); | ||
| 47 | 76 | } | |
| 48 | 77 | ||
| 49 | 78 | process.exit(1); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments