update version 0.5.5 to 0.5.6

This commit is contained in:
Vanessa
2013-02-05 17:01:44 +08:00
parent 70f3148608
commit a1abd17ae2
14 changed files with 264 additions and 166 deletions

42
toolers/update-version.js Normal file
View File

@@ -0,0 +1,42 @@
var version = "",
newVersion = "";
process.argv.forEach(function (val, index) {
if (index === 2) {
version = val;
}
if (index === 3) {
newVersion = val;
}
});
var fs = require("fs"),
path = require('path');
var getPropertiesFiles = function (root) {
var res = [],
files = fs.readdirSync(root);
files.forEach(function (file) {
var pathname = root + '/' + file,
stat = fs.lstatSync(pathname);
if (!stat.isDirectory()) {
if (path.basename(pathname) === "skin.properties") {
res.push(pathname);
}
} else {
res = res.concat(getPropertiesFiles(pathname));
}
});
return res;
};
(function () {
var skins = getPropertiesFiles("..");
for (var i = 0; i < skins.length; i++) {
var file = fs.readFileSync(skins[i], "UTF-8");
fs.writeFileSync(skins[i], file.replace("forSolo=" + version, "forSolo=" + newVersion), "UTF-8");
}
})();