bin/index.js

#!/usr/bin/env node
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const commander_1 = require("commander");
const wpkg = tslib_1.__importStar(require("../lib/index"));
/**
 * Below are the APIs of CLI (Command Line Interface). Some inappropriate titles are used because they are generated by JsDoc.
 *
 * @namespace CLI
 */
/**
 * @function bundle
 * @memberof CLI
 * @example
Usage: wsh-packager bundle [options] <dirPath>

Bundles .js, .vbs (WSH scripts) files defined in .wsf file.

Options:
  -V, --version              output the version number
  -J, --job-id <RegExp>      A job id to be bundled (Default: "\.(js|vbs|wsf)$").
  -D, --base-dir <path>      Default is the <dirPath>
  -I, --ignore-src <RegExp>  Ex. "main\.js$"
  -h, --help                 display help for command

// Ex1.
$ wsh-packager bundle "D:\MyWshProject"
done

// Ex2.
$ wsh-packager bundle "D:\MyWshProject" --job-id "JobName\.wsf$"
done
 */
commander_1.program
    .command('bundle <dirPath>')
    .version('1.0.0')
    .description('Bundles .js, .vbs (WSH scripts) files defined in .wsf file.')
    .option('-J, --job-id <RegExp>', 'A job id to be bundled (Default: "\\.(js|vbs|wsf)$").')
    .option('-D, --base-dir <path>', 'Default is the <dirPath>')
    .option('-I, --ignore-src <RegExp>', 'Ex. "main\\.js$"')
    .action((dirPath, options) => {
    wpkg.bundleWshFiles(dirPath, {
        jobId: options.jobId,
        baseDir: options.baseDir,
        ignoreSrc: options.ignoreSrc,
    });
    process.stdout.write('done');
});
commander_1.program.parse(process.argv);
//# sourceMappingURL=index.js.map