Side navigation
Ticket #2101: build-version-pack.patch
File build-version-pack.patch, 0.9 KB (added by emartin24, December 31, 2007 05:38PM UTC)
version.js fix for global @VERSION replacement and pack.js fix for outFile filename
Index: build/pack.js
===================================================================
--- build/pack.js (revision 4334)
+++ build/pack.js (working copy)
@@ -5,8 +5,10 @@
// arguments
var inFile = arguments[0];
-var outFile = arguments[1] || inFile.replace(/\.js$/, "pack.js");
+var outFile = arguments[1] || inFile.replace(/\.js$/, ".pack.js");
+print(inFile);
+
// options
var base62 = true;
var shrink = true;
Index: build/version.js
===================================================================
--- build/version.js (revision 4334)
+++ build/version.js (working copy)
@@ -1,4 +1,4 @@
load("build/js/writeFile.js");
var file = arguments[0];
-writeFile(file, readFile(file).replace("@VERSION", readFile("version.txt").replace( /^\s+|\s+$/g, "" )));
+writeFile(file, readFile(file).replace(RegExp("@VERSION", "g"), readFile("version.txt").replace( /^\s+|\s+$/g, "" )));
Download in other formats:
Original Format
File build-version-pack.patch, 0.9 KB (added by emartin24, December 31, 2007 05:38PM UTC)
version.js fix for global @VERSION replacement and pack.js fix for outFile filename
Index: build/pack.js
===================================================================
--- build/pack.js (revision 4334)
+++ build/pack.js (working copy)
@@ -5,8 +5,10 @@
// arguments
var inFile = arguments[0];
-var outFile = arguments[1] || inFile.replace(/\.js$/, "pack.js");
+var outFile = arguments[1] || inFile.replace(/\.js$/, ".pack.js");
+print(inFile);
+
// options
var base62 = true;
var shrink = true;
Index: build/version.js
===================================================================
--- build/version.js (revision 4334)
+++ build/version.js (working copy)
@@ -1,4 +1,4 @@
load("build/js/writeFile.js");
var file = arguments[0];
-writeFile(file, readFile(file).replace("@VERSION", readFile("version.txt").replace( /^\s+|\s+$/g, "" )));
+writeFile(file, readFile(file).replace(RegExp("@VERSION", "g"), readFile("version.txt").replace( /^\s+|\s+$/g, "" )));