Skip to content

Commit b18ef4c

Browse files
maxkorpMaximiliano Korp
authored andcommitted
Don't run postbuild when we detect electron install
1 parent ffa7048 commit b18ef4c

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

lifecycleScripts/postinstall.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ module.exports = function install() {
2424
// cleaning up
2525
return Promise.resolve();
2626
}
27+
if (buildFlags.isElectron || buildFlags.isNWjs) {
28+
// If we're building for electron or NWjs, we're unable to require the
29+
// built library so we have to just assume success, unfortunately.
30+
return Promise.resolve();
31+
}
2732

2833
return exec("node " + path.join(rootPath, "dist/nodegit.js"))
2934
.catch(function(e) {

utils/buildFlags.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ try {
1111
}
1212

1313
module.exports = {
14-
debugBuild: process.env.BUILD_DEBUG,
14+
debugBuild: !!process.env.BUILD_DEBUG,
15+
isElectron: process.env.npm_config_runtime === "electron",
1516
isGitRepo: isGitRepo,
16-
mustBuild: isGitRepo || process.env.BUILD_DEBUG || process.env.BUILD_ONLY,
17+
isNwjs: process.env.npm_config_runtime === "node-webkit",
18+
mustBuild: !!(isGitRepo || process.env.BUILD_DEBUG || process.env.BUILD_ONLY)
1719
};

0 commit comments

Comments
 (0)