Skip to content

Commit 2455cef

Browse files
make host configureable (#3)
1 parent cc7ea7a commit 2455cef

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

bin.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@ var argv = require('yargs')
2929
.alias('d', 'direct')
3030
.default('d', false)
3131
.describe('d', 'upload directly to the table (create/append only)'.yellow)
32+
.alias('s', 'subdomainless')
33+
.boolean('s')
34+
.default('s', undefined)
35+
.describe('s', 'whether to use subdomainless url mode'.yellow)
36+
.alias('D', 'domain')
37+
.describe('D', 'whether to use the non default domain'.yellow)
3238
.example('$0 -p ./postgres.json -c ./cartodb.json inTable outTable', 'specify the files'.green)
3339
.example('$0 inTable', 'use environmental variables and the same table names'.green)
3440
.example('$0 inTable outTable --no-g', 'use environmental variables and pass no geometry'.green)
@@ -70,7 +76,9 @@ var config = {
7076
method: getMethod(),
7177
progress: true,
7278
batchSize: parseInt(argv.b, 10),
73-
direct: argv.d
79+
direct: argv.d,
80+
domain: argv.D,
81+
subdomainless: argv.s
7482
};
7583
convert(config, function (err) {
7684
if (err) {

index.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@ function convert(config, callback) {
2424
if (config.direct) {
2525
options.direct = config.direct;
2626
}
27+
if (config.domain) {
28+
options.domain = config.domain;
29+
}
30+
if (config.subdomainless) {
31+
options.subdomainless = config.subdomainless;
32+
}
2733
var cartodbTable = config.cartodb.table || postgresTable;
2834
var bar;
2935
function tick(num) {

0 commit comments

Comments
 (0)