From db9747cb39a004e177f8f085d9b98431ddfb8857 Mon Sep 17 00:00:00 2001 From: David Glasser Date: Tue, 5 Mar 2013 14:29:28 -0800 Subject: [PATCH] read engine version as string --- lib/files.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/files.js b/lib/files.js index 0d65af30ac..5819525c95 100644 --- a/lib/files.js +++ b/lib/files.js @@ -212,7 +212,8 @@ var files = module.exports = { // Read the '.engine_version.txt' file. If in a checkout, throw an error. getEngineVersion: function () { if (!files.in_checkout()) { - return fs.readFileSync(path.join(files.getCurrentEngineDir(), '.engine_version.txt')); + return fs.readFileSync( + path.join(files.getCurrentEngineDir(), '.engine_version.txt'), 'utf8'); } else { throw new Error("Unexpected. Git checkouts don't have engine versions."); } @@ -327,7 +328,7 @@ var files = module.exports = { else { if (!options.transform_contents) { // XXX reads full file into memory.. lame. - fs.writeFileSync(full_to, fs.readFileSync(full_from)) + fs.writeFileSync(full_to, fs.readFileSync(full_from)); } else { var contents = fs.readFileSync(full_from); contents = options.transform_contents(contents, f);