Merge branch 'master' into serverModule

This commit is contained in:
calcnerd256 2012-01-30 11:17:16 -06:00
commit 16735fe4fa
35 changed files with 935 additions and 904 deletions

View file

@ -4,6 +4,7 @@ var ueberDB = require("ueberDB");
var mysql = require("mysql");
var async = require("async");
var Changeset = require("../node/utils/Changeset");
var randomString = require("../node/utils/randomstring");
var AttributePoolFactory = require("../node/utils/AttributePoolFactory");
var settingsFile = process.argv[2];
@ -450,18 +451,3 @@ function parsePage(array, pageStart, offsets, data, json)
start+=unitLength;
}
}
/**
* Generates a random String with the given length. Is needed to generate the Author Ids
*/
function randomString(len)
{
var chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
var randomstring = '';
for (var i = 0; i < len; i++)
{
var rnum = Math.floor(Math.random() * chars.length);
randomstring += chars.substring(rnum, rnum + 1);
}
return randomstring;
}

View file

@ -33,6 +33,13 @@ if [ ! $(echo $NPM_VERSION | cut -d "." -f 1) = "1" ]; then
exit 1
fi
#check node version
NODE_VERSION=$(node --version)
if [ ! $(echo $NODE_VERSION | cut -d "." -f 1-2) = "v0.6" ]; then
echo "You're running a wrong version of node, you're using $NODE_VERSION, we need v0.6.x" >&2
exit 1
fi
#Does a settings.json exist? if no copy the template
if [ ! -f "settings.json" ]; then
echo "Copy the settings template to settings.json..."