forked from openfl/openfl
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpostinstall.js
More file actions
41 lines (25 loc) · 891 Bytes
/
Copy pathpostinstall.js
File metadata and controls
41 lines (25 loc) · 891 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/usr/bin/env node
var fs = require ("fs");
var child_process = require ("child_process");
function updateLibrary (name, url) {
if (fs.existsSync ("./" + name)) {
if (!fs.lstatSync ("./" + name).isSymbolicLink ()) {
process.chdir ("./" + name);
child_process.execSync ("git pull", { stdio: "inherit" });
process.chdir ("..");
}
} else {
child_process.execSync ("git clone " + url, { stdio: "inherit" });
}
}
try {
process.chdir ("./node_modules");
updateLibrary ("lime", "https://github.com/openfl/lime");
// updateLibrary ("hxgenjs", "https://github.com/kevinresol/hxgenjs");
// updateLibrary ("tink_macro", "https://github.com/haxetink/tink_macro");
// updateLibrary ("tink_core", "https://github.com/haxetink/tink_core");
} catch (error) {
console.error ("Error running postinstall script");
console.error (error);
return;
}