From: jsimomaa Date: Tue, 4 Apr 2017 06:58:56 +0000 (+0300) Subject: Adding missing bin in tileserver-mapnik X-Git-Tag: v1.31.0~9 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=b10b919b6756df3b423dd416df6b1b06abc15f22;p=simantics%2Fdistrict.git Adding missing bin in tileserver-mapnik refs #6958 Change-Id: I711cfa80c3102bb6cb52a3c5b82706fd79016b9c --- diff --git a/org.simantics.maps.server/server/tileserver-mapnik/.gitignore b/org.simantics.maps.server/server/tileserver-mapnik/.gitignore index 68b9e277..b740c70d 100644 --- a/org.simantics.maps.server/server/tileserver-mapnik/.gitignore +++ b/org.simantics.maps.server/server/tileserver-mapnik/.gitignore @@ -1,2 +1,5 @@ node_modules/ bower_components/ + +# allow bin +!bin/ \ No newline at end of file diff --git a/org.simantics.maps.server/server/tileserver-mapnik/bin/tessera.js b/org.simantics.maps.server/server/tileserver-mapnik/bin/tessera.js new file mode 100644 index 00000000..34f5d3df --- /dev/null +++ b/org.simantics.maps.server/server/tileserver-mapnik/bin/tessera.js @@ -0,0 +1,71 @@ +#!/usr/bin/env node + +"use strict"; + +var nomnom = require("nomnom") + .options({ + uri: { + position: 0, + help: "tilelive URI to serve" + }, + cacheSize: { + full: "cache-size", + abbr: "C", + metavar: "SIZE", + help: "Set the cache size (in MB)", + default: 10 + }, + config: { + abbr: "c", + metavar: "CONFIG", + help: "Provide a configuration file or directory" + }, + port: { + abbr: "p", + metavar: "PORT", + help: "Set the HTTP Port", + default: 8080 + }, + require: { + abbr: "r", + metavar: "MODULE", + help: "Require a specific tilelive module", + list: true + }, + sourceCacheSize: { + full: "source-cache-size", + abbr: "S", + metavar: "SIZE", + help: "Set the source cache size (in # of sources)", + default: 10 + }, + version: { + abbr: "v", + flag: true, + help: "Show version info", + callback: function() { + return "tessera v" + require("../package.json").version; + } + } + }) + .help("A tilelive URI or configuration file is required."); + +var argv = (process.env.TESSERA_OPTS || "") + .split(" ") + .concat(process.argv.slice(2)) + .filter(function(x) { + return !!x; + }); + +var opts = nomnom.parse(argv); + +switch (true) { +case opts.version: + return process.exit(); + +case !opts.uri && !opts.config: + return nomnom.print(nomnom.getUsage()); + +default: + return require("../server")(opts); +}