12345678910111213141516171819202122232425262728 |
- var sys = require('sys'), fs = require('fs');
- var arguments = process.argv.splice(3);
- if (process.argv[2] == "true") {
- smalltalk.debugMode = true;
- } else {
- smalltalk.debugMode = false;
- }
- console.log("Compiling in debugMode: " + smalltalk.debugMode);
- arguments.forEach(function(val, index, array) {
- if (/\.st/.test(val)) {
- sys.puts("Reading file " + val);
- code = fs.readFileSync(val, "utf8");
- smalltalk.Importer._new()._import_(code._stream());
- } else {
- sys.puts("Exporting category " + val);
- fs.writeFileSync(val + ".js", smalltalk.Exporter._new()._exportCategory_(val));
- }
- });
|