Skip to content

Commit 14f4a7a

Browse files
committed
Don't run postbuild when we detect electron install
Since we can't require it from node if it's compiled for electron, we should just assume success for now
1 parent 770dbd2 commit 14f4a7a

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

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) {
28+
// If we're building for electron, we're unable to require things so we should
29+
// 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: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ 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+
mustBuild: !!(isGitRepo || process.env.BUILD_DEBUG || process.env.BUILD_ONLY)
1718
};

0 commit comments

Comments
 (0)