123456789101112131415161718192021222324252627282930313233 |
- var sys = require('sys'), fs = require('fs');
- var arguments = process.argv.splice(4);
- var deploy = (process.argv[2] == "true");
- suffix = process.argv[3];
- if (suffix == "no-silly-suffix") {
- suffix = "";
- }
- 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 " + (deploy ? "(debug + deploy)" : "(debug)") + " category "
- + val + " as " + val + suffix + ".js" + (deploy ? " and " + val + suffix + ".deploy.js" : ""));
- fs.writeFileSync(val + suffix + ".js", smalltalk.Exporter._new()._exportCategory_(val));
- if (deploy) {
- fs.writeFileSync(val + suffix + ".deploy.js", smalltalk.StrippedExporter._new()._exportCategory_(val));
- }
- }
- });
|