Skip to content

Commit 6b6493b

Browse files
committed
Windows fixes.
1 parent 6ed3027 commit 6b6493b

File tree

3 files changed

+16
-10
lines changed

3 files changed

+16
-10
lines changed

generate/index.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,16 @@ const ejs = require("ejs");
44
const path = require("path");
55
const idefs = require("./idefs");
66

7+
8+
var local = path.join.bind(null, __dirname);
9+
710
var classTemplate = ejs.compile(
8-
"" + fs.readFileSync(String(__dirname + "/templates/class.cc.ejs")), {
11+
"" + fs.readFileSync(local("templates/class.cc.ejs")), {
912
filename: "class.cc"
1013
});
1114

1215
var headerTemplate = ejs.compile(
13-
"" + fs.readFileSync(String(__dirname + "/templates/header.h.ejs")), {
16+
"" + fs.readFileSync(local("templates/header.h.ejs")), {
1417
filename: "header.h"
1518
});
1619

@@ -21,10 +24,9 @@ Object.keys(idefs).forEach(function(keyName) {
2124
return;
2225
}
2326

24-
fs.writeFileSync(
25-
__dirname + "/../include/" + idef.filename, headerTemplate(idef));
27+
fs.writeFileSync(local("../include/", idef.filename), headerTemplate(idef));
2628

2729
fs.writeFileSync(
28-
__dirname + "/../src/" + path.basename(idef.filename, ".h") + ".cc",
30+
local("../src/", path.basename(idef.filename, ".h")) + ".cc",
2931
classTemplate(idef));
3032
});

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,7 @@
6666
"lint": "jshint src",
6767
"test": "cd test && nodeunit nodegit.js",
6868
"publish": "node-pre-gyp package && node-pre-gyp publish",
69-
"codegen": "node build/codegen/t.js ; node build/codegen/generate.js",
70-
"generate": "node generate/setup ; node generate",
69+
"generate": "node generate/setup && node generate",
7170
"install": "npm run generate && node install"
7271
}
7372
}

vendor/libgit2.gyp

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -200,9 +200,6 @@
200200
"vendor/libgit2/src/transports/smart_pkt.c",
201201
"vendor/libgit2/src/transports/smart_protocol.c",
202202
"vendor/libgit2/src/transports/ssh.c",
203-
"vendor/libgit2/src/unix/map.c",
204-
"vendor/libgit2/src/unix/posix.h",
205-
"vendor/libgit2/src/unix/realpath.c",
206203
"vendor/libgit2/src/xdiff/xdiff.h",
207204
"vendor/libgit2/src/xdiff/xdiffi.c",
208205
"vendor/libgit2/src/xdiff/xdiffi.h",
@@ -220,6 +217,13 @@
220217
"vendor/libgit2/src/xdiff/xutils.h"
221218
],
222219
"conditions": [
220+
["OS=='win'", {}, {
221+
"sources": [
222+
"vendor/libgit2/src/unix/map.c",
223+
"vendor/libgit2/src/unix/posix.h",
224+
"vendor/libgit2/src/unix/realpath.c",
225+
]
226+
}],
223227
["OS=='linux'", {
224228
"cflags": [
225229
"-w",
@@ -270,6 +274,7 @@
270274
"vendor/libgit2/src/win32/findfile.c",
271275
"vendor/libgit2/src/win32/findfile.h",
272276
"vendor/libgit2/src/win32/git2.rc",
277+
"vendor/libgit2/src/win32/map.c",
273278
"vendor/libgit2/src/win32/mingw-compat.h",
274279
"vendor/libgit2/src/win32/msvc-compat.h",
275280
"vendor/libgit2/src/win32/posix.h",

0 commit comments

Comments
 (0)