Skip to content

Commit 7f451b3

Browse files
committed
Emscripten stuff.
1 parent 5007d50 commit 7f451b3

File tree

11 files changed

+289426
-907
lines changed

11 files changed

+289426
-907
lines changed

browser.js

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
// Used to detect for Cygwin
2+
var os = require('os');
3+
4+
// Required for Windows/Cygwin support
5+
var root = [__dirname, '/vendor/libgit2/build/shared'].join(''),
6+
path = process.env.PATH;
7+
8+
if (~os.type().indexOf('CYGWIN') && !~path.indexOf(root)) {
9+
process.env.PATH = root + ':' + path;
10+
}
11+
12+
// Assign raw api to module
13+
var rawApi = require('./build/emscripten/nodegit');
14+
15+
// Set the exports prototype to the raw API.
16+
exports.__proto__ = rawApi;
17+
18+
// Import extensions
19+
//require('./lib/commit.js');
20+
//require('./lib/blob.js');
21+
//require('./lib/object.js');
22+
//require('./lib/signature.js');
23+
//require('./lib/odb.js');
24+
//require('./lib/oid.js');
25+
//require('./lib/index.js');
26+
//require('./lib/repository.js');
27+
//require('./lib/reference.js');
28+
//require('./lib/revwalk.js');
29+
//require('./lib/tree.js');
30+
31+
// Set version
32+
exports.version = require('./package').version;
33+
34+
// Initialize threads
35+
//exports.Threads.init();
36+
37+
var glob = typeof window !== "undefined" ? window : global;
38+
39+
glob.nodegit = exports;

0 commit comments

Comments
 (0)