Skip to content

Commit f2eafe2

Browse files
author
John Haley
committed
Move postinstall script from bash to node
1 parent 1a3610d commit f2eafe2

File tree

3 files changed

+21
-13
lines changed

3 files changed

+21
-13
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,6 @@
8989
"recompileDebug": "node-gyp configure --debug build",
9090
"rebuildDebug": "node generate && node-gyp configure --debug build",
9191
"xcodeDebug": "node-gyp configure -- -f xcode",
92-
"postinstall": "bash postinstall.sh"
92+
"postinstall": "node postinstall.js"
9393
}
9494
}

postinstall.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/usr/bin/env node
2+
3+
var fs = require("fs");
4+
var child_process = require("child_process");
5+
6+
if (process.platform !== "linux") {
7+
return;
8+
}
9+
10+
child_process.exec("node lib/nodegit.js", function(error, stdout, stderr) {
11+
if (stderr && ~stderr.indexOf("libstdc++")) {
12+
console.log("[ERROR] Seems like the latest libstdc++ is missing on your system!");
13+
console.log("");
14+
console.log("On Ubuntu you can install it using:");
15+
console.log("");
16+
console.log("$ sudo add-apt-repository ppa:ubuntu-toolchain-r/test");
17+
console.log("$ sudo apt-get update");
18+
console.log("$ sudo apt-get install libstdc++-4.9-dev");
19+
}
20+
});

postinstall.sh

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)