Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
interpret: function (args) {
cli.setArgv(args);
cli.options = {};
cli.enable("version", "glob", "help");
cli.setApp(path.resolve(__dirname + "/../package.json"));
var options = cli.parse(OPTIONS);
// Use config file if specified
var config;
if (options.config) {
config = exports.loadConfig(options.config);
}
switch (true) {
// JSLint reporter
case options.reporter === "jslint":
case options["jslint-reporter"]:
options.reporter = "./reporters/jslint_xml.js";
break;
// CheckStyle (XML) reporter
interpret(args) {
cli.setArgv(args)
cli.options = {}
cli.enable('version', 'glob', 'help')
cli.setApp(path.resolve(`${__dirname}/../package.json`))
const opts = cli.parse(options)
// Set env variables as option
if (process.env.PERFLINT_KEY) opts.key = process.env.PERFLINT_KEY
if (process.env.PERFLINT_SERVER) opts.server = process.env.PERFLINT_SERVER
let config
if (opts.config) {
config = command.getConfig(opts.config)
} else {
config = command.getConfig()
}
if (!config || config === 1) return 1
const defaults = _.merge(defaultConf, opts)
interpret: function (args) {
cli.setArgv(args);
cli.options = {};
cli.enable("version", "glob", "help");
cli.setApp(path.resolve(__dirname + "/../../package.json"));
var options = cli.parse(OPTIONS);
// Use config file if specified
var config;
if (options.config) {
config = loadConfig(options.config);
}
switch (true) {
// JSLint reporter
case options.reporter === "jslint":
case options["jslint-reporter"]:
options.reporter = "../reporters/jslint_xml.js";
break;
// CheckStyle (XML) reporter
interpret: function (args) {
cli.setArgv(args);
cli.options = {};
cli.enable("version", "glob", "help");
cli.setApp(path.resolve(__dirname + "/../package.json"));
var options = cli.parse(OPTIONS);
// Use config file if specified
var config;
if (options.config) {
config = exports.loadConfig(options.config);
}
switch (true) {
// JSLint reporter
case options.reporter === "jslint":
case options["jslint-reporter"]:
options.reporter = "./reporters/jslint_xml.js";
break;
// CheckStyle (XML) reporter
interpret: function (args) {
cli.setArgv(args);
cli.options = {};
cli.enable("version", "glob", "help");
cli.setApp(path.resolve(__dirname + "/../../package.json"));
var options = cli.parse(OPTIONS);
// Use config file if specified
var config;
if (options.config) {
config = loadConfig(options.config);
}
switch (true) {
// JSLint reporter
case options.reporter === "jslint":
case options["jslint-reporter"]:
options.reporter = "../reporters/jslint_xml.js";
break;
// CheckStyle (XML) reporter
interpret: function (args) {
cli.setArgv(args);
cli.options = {};
cli.enable("version", "glob", "help");
cli.setApp(path.resolve(__dirname + "/../package.json"));
var options = cli.parse(OPTIONS);
// Use config file if specified
var config;
if (options.config) {
config = exports.loadConfig(options.config);
}
switch (true) {
// JSLint reporter
case options.reporter === "jslint":
case options["jslint-reporter"]:
options.reporter = "./reporters/jslint_xml.js";
break;
// CheckStyle (XML) reporter
interpret: function (args) {
cli.setArgv(args);
cli.options = {};
cli.enable("version", "glob", "help");
cli.setApp(path.resolve(__dirname + "/../package.json"));
var options = cli.parse(OPTIONS);
// Use config file if specified
var config;
if (options.config) {
config = exports.loadConfig(options.config);
}
switch (true) {
// JSLint reporter
case options.reporter === "jslint":
case options["jslint-reporter"]:
options.reporter = "./reporters/jslint_xml.js";
break;
// CheckStyle (XML) reporter
interpret: function (args) {
cli.setArgv(args);
cli.options = {};
cli.enable("version", "glob", "help");
cli.setApp(path.resolve(__dirname + "/../package.json"));
var options = cli.parse(OPTIONS);
// Use config file if specified
var config;
if (options.config) {
config = exports.loadConfig(options.config);
}
switch (true) {
// JSLint reporter
case options.reporter === "jslint":
case options["jslint-reporter"]:
options.reporter = "./reporters/jslint_xml.js";
break;
// CheckStyle (XML) reporter
interpret: function(args) {
debug('Beep bop beep .. starting up..')
cli.setArgv(args)
cli.options = {}
cli.enable('version', 'glob', 'help')
cli.setApp(path.resolve(__dirname + '/../package.json'))
var opts = cli.parse(options)
command.run(opts)
},
#!/usr/bin/env node
const cli = require('cli');
const pkg = require('../package.json');
const packer = require("../index.js");
cli.setApp(pkg.name, pkg.version);
cli.enable("version", "status");
cli.setUsage("mm-packer -s files/original -o files/packed");
cli.parse({
source: ["s", "Source directory", "file"],
output: ["o", "Output directory", "file"],
name: ["n", "Pack files name", "string", "pack"],
});
cli.main((args, options) => {
if(options.source && options.output && options.name) {
options.debug = process.argv.indexOf("--debug") > -1;
packer(options);
} else {
cli.getUsage();
}