|
@@ -5,7 +5,7 @@
|
|
var sys = require('sys'), fs = require('fs');
|
|
var sys = require('sys'), fs = require('fs');
|
|
|
|
|
|
// Only care about our arguments, strip away node, all.js and debug flag.
|
|
// Only care about our arguments, strip away node, all.js and debug flag.
|
|
-var arguments = process.argv.splice(3);
|
|
|
|
|
|
+var arguments = process.argv.splice(4);
|
|
|
|
|
|
// First argument is debugMode: "true" or "false"
|
|
// First argument is debugMode: "true" or "false"
|
|
if (process.argv[2] == "true") {
|
|
if (process.argv[2] == "true") {
|
|
@@ -13,6 +13,13 @@ if (process.argv[2] == "true") {
|
|
} else {
|
|
} else {
|
|
smalltalk.debugMode = false;
|
|
smalltalk.debugMode = false;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+// Second argument is prefix: "no-silly-prefix" means none
|
|
|
|
+prefix = process.argv[3];
|
|
|
|
+if (prefix == "no-silly-prefix") {
|
|
|
|
+ prefix = "";
|
|
|
|
+}
|
|
|
|
+
|
|
console.log("Compiling in debugMode: " + smalltalk.debugMode);
|
|
console.log("Compiling in debugMode: " + smalltalk.debugMode);
|
|
|
|
|
|
// If it ends with .st, import it, otherwise export category as .js
|
|
// If it ends with .st, import it, otherwise export category as .js
|
|
@@ -22,7 +29,7 @@ arguments.forEach(function(val, index, array) {
|
|
code = fs.readFileSync(val, "utf8");
|
|
code = fs.readFileSync(val, "utf8");
|
|
smalltalk.Importer._new()._import_(code._stream());
|
|
smalltalk.Importer._new()._import_(code._stream());
|
|
} else {
|
|
} else {
|
|
- sys.puts("Exporting category " + val);
|
|
|
|
- fs.writeFileSync(val + ".js", smalltalk.Exporter._new()._exportCategory_(val));
|
|
|
|
|
|
+ sys.puts("Exporting category " + val + " as " + prefix + val + ".js");
|
|
|
|
+ fs.writeFileSync(prefix + val + ".js", smalltalk.Exporter._new()._exportCategory_(val));
|
|
}
|
|
}
|
|
});
|
|
});
|