From c711dc328ef639e738aef2bc648c83252254e5bd Mon Sep 17 00:00:00 2001 From: Sandro Santilli Date: Fri, 17 Jan 2014 17:47:37 +0100 Subject: [PATCH] Fix XML print from in show_style for token styles (#110) --- tools/show_style | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tools/show_style b/tools/show_style index d52ac9a9..f2048906 100755 --- a/tools/show_style +++ b/tools/show_style @@ -63,7 +63,13 @@ global.environment = require('${CONFIG}'); var serverOptions = require('${BASEDIR}/lib/cartodb/server_options'); // _after_ setting global.environment var grainstore = require('${BASEDIR}/node_modules/windshaft/node_modules/grainstore/lib/grainstore'); var mml_store = new grainstore.MMLStore(serverOptions.redis, serverOptions.grainstore); -var mml_builder = mml_store.mml_builder({dbname:'${dbname}', table:'${token}'}, +var builderconfig = {dbname:'${dbname}'}; +if ( '${token}'.match(/^~/) ) { + builderconfig.token = '${token}'.substring(1); +} else { + builderconfig.table = '${token}'; +} +var mml_builder = mml_store.mml_builder(builderconfig, function(err, payload) { if ( err ) throw err; mml_builder.toXML(function(err, xml) {