Procházet zdrojové kódy

Oops, forgot nodecompile.js fix for prefixing.

Göran Krampe před 13 roky
rodič
revize
22b973a0ec
1 změnil soubory, kde provedl 10 přidání a 3 odebrání
  1. 10 3
      nodejs/nodecompile.js

+ 10 - 3
nodejs/nodecompile.js

@@ -5,7 +5,7 @@
 var sys = require('sys'), fs = require('fs');
 
 // 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"
 if (process.argv[2] == "true") {
@@ -13,6 +13,13 @@ if (process.argv[2] == "true") {
 } else {
   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);
 
 // 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");
     smalltalk.Importer._new()._import_(code._stream());
   } 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));
   }
 });