FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

add atom shell support · nodegit/nodegit@80c0f86 · GitHub

Repository navigation

Commit 80c0f86

Browse files
committed
add atom shell support
1 parent c82343c commit 80c0f86

3 files changed

Lines changed: 39 additions & 17 deletions

File tree

‎lifecycleScripts/clean.js‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ npm.load({
6262

6363
var modulesToPrune = [
6464
"for-node-webkit",
65+
"which-native-nodish",
6566
"fs-extra",
6667
"node-pre-gyp",
6768
"npm"

‎lifecycleScripts/install.js‎

Lines changed: 36 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,28 @@ var fs = require("fs");
66
var local = path.join.bind(path, __dirname);
77

88
var checkPrepared = require(local("checkPrepared"));
9-
var forNodeWebkit = require("for-node-webkit");
9+
var whichNativeNodish = require("which-native-nodish");
1010
var prepareForBuild = require(local("prepareForBuild"));
1111

1212
var exec = promisify(function(command, opts, callback) {
1313
return require("child_process").exec(command, opts, callback);
1414
});
15+
var nwVersion = null;
16+
var asVersion = null;
1517

16-
return forNodeWebkit(local(".."))
18+
return whichNativeNodish(local(".."))
1719
.then(function(results) {
18-
return results.nwVersion;
20+
nwVersion = results.nwVersion;
21+
asVersion = results.asVersion;
1922
})
20-
.then(function(nodeWebkitVersion) {
21-
if (nodeWebkitVersion) {
22-
console.info("[nodegit] Must build for node-webkit");
23-
return checkAndBuild(nodeWebkitVersion);
23+
.then(function() {
24+
if (nwVersion) {
25+
console.info("[nodegit] Must build for node-webkit/nw.js");
26+
return checkAndBuild();
27+
}
28+
else if (asVersion) {
29+
console.info("[nodegit] Must build for atom-shell");
30+
return checkAndBuild();
2431
}
2532
if (fs.existsSync(local("../.didntcomefromthenpmregistry"))) {
2633
return checkAndBuild();
@@ -48,7 +55,7 @@ return forNodeWebkit(local(".."))
4855
});
4956

5057

51-
function checkAndBuild(nwVersion) {
58+
function checkAndBuild() {
5259
console.info("[nodegit] Making sure dependencies are available and native " +
5360
"code is generated");
5461

@@ -82,14 +89,28 @@ function build(nwVersion) {
8289
maxBuffer: Number.MAX_VALUE
8390
};
8491

85-
var builder = nwVersion ? "nw-gyp" : "node-gyp";
86-
var target = (nwVersion ? "--target=\"" + nwVersion + "\"": "");
92+
var prefix = "";
93+
var target = "";
8794
var debug = (process.env.BUILD_DEBUG ? " --debug" : "");
88-
var cmd = path.resolve(".", "node_modules", ".bin", builder) +
89-
" clean configure" +
90-
debug +
91-
target +
92-
" build";
95+
var builder = "node-gyp";
96+
var dist-url = "";
97+
98+
if (asVersion) {
99+
prefix = process.platform == 'win32'
100+
? 'SET HOME="~/.atom-shell-gyp" &&s'
101+
: 'HOME=~/.atom-shell-gyp';
102+
103+
target = "--target=" + asVersion;
104+
105+
dist-url = "--dist-url=https://gh-contractor-zcbenz.s3.amazonaws.com/atom-shell/dist";
106+
}
107+
else if (nwVersion) {
108+
builder = "nw-gyp";
109+
target = "--target=" + nwVersion;
110+
}
111+
112+
builder = path.resolve(".", "node_modules", ".bin", builder);
113+
var cmd = [prefix, builder, "rebuild", target, disturl].join(" ").trim();
93114

94115
return exec(cmd, opts)
95116
.then(function() {

‎package.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,12 @@
5454
"node-pre-gyp"
5555
],
5656
"dependencies": {
57-
"for-node-webkit": "0.0.2",
5857
"fs-extra": "~0.15.0",
5958
"node-pre-gyp": "~0.6.1",
6059
"nodegit-promise": "~1.0.0",
6160
"npm": "^2.1.18",
62-
"promisify-node": "~0.1.2"
61+
"promisify-node": "~0.1.2",
62+
"which-native-nodish": "^1.0.0"
6363
},
6464
"devDependencies": {
6565
"mocha": "~2.1.0",

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL