-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathpackage.js
49 lines (42 loc) · 1.37 KB
/
package.js
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
42
43
44
45
46
47
48
49
require("./paths");
var Sys = require("sys"),
Fs = require("fs"),
Path = require("path");
if (module === require.main) {
if (!Path.existsSync(__dirname + "/support/apf")) {
console.log("Setting up path to Ajax.org Platform (apf)");
require("child_process").exec("ln -s " + Path.normalize(__dirname + "/../apf") + " " + __dirname + "/support/apf", function(err) {
if (err) {
console.log("ERROR: could not create symlink: ", err);
return process.exit(1);
}
boot();
});
}
else
boot();
}
function boot() {
require("apf-node");
require("proc");
require("files");
require("defines");
require("xslt");
require("proc/combine");
require("proc/compress");
require("proc/encoder");
require("proc/inline");
require("proc/docgen");
//require("proc/vcs");
var argv = process.argv;
var project = (argv.length == 3) ? argv[2] : "apf_release.apr";
Sys.puts("using file: " + __dirname + "/projects/" + project);
if (!Path.existsSync(project)) {
project = __dirname + "/projects/" + project;
if (!Path.existsSync(project)) {
console.log("ERROR: unable to find project file");
return process.exit(1);
}
}
apf.ProcParser.parse(Fs.readFileSync(project, "utf8"));
}