This commit is contained in:
25
node_modules/@mapbox/mapbox-gl-style-spec/bin/gl-style-composite.js
generated
vendored
Executable file
25
node_modules/@mapbox/mapbox-gl-style-spec/bin/gl-style-composite.js
generated
vendored
Executable file
@@ -0,0 +1,25 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
// @flow
|
||||
/* eslint-disable no-process-exit */
|
||||
|
||||
import fs from 'fs';
|
||||
import minimist from 'minimist';
|
||||
|
||||
/* eslint import/no-unresolved: [error, { ignore: ['^@mapbox/mapbox-gl-style-spec$'] }] */
|
||||
/* $FlowFixMe[cannot-resolve-module] */
|
||||
import {format, composite} from '@mapbox/mapbox-gl-style-spec';
|
||||
|
||||
const argv = minimist(process.argv.slice(2));
|
||||
|
||||
if (argv.help || argv.h || (!argv._.length && process.stdin.isTTY)) {
|
||||
help();
|
||||
process.exit(0);
|
||||
}
|
||||
|
||||
console.log(format(composite(JSON.parse(fs.readFileSync(argv._[0]).toString()))));
|
||||
|
||||
function help() {
|
||||
console.log('usage:');
|
||||
console.log(' gl-style-composite style.json');
|
||||
}
|
||||
Reference in New Issue
Block a user